php-session

PHP Complete Object Graph not stored in Session

Hello, I have read other posts on stack overflow on the issue but my question is a little different.. When storing an object in the Session does PHP save the Complete Object Graph in the session? I am having problems accessing some of the properties of the Object AFTER it is read from the Session. The object i am storing has complex...

PHP Session help

Hello, I have a session that works perfectly expect for one, if I close the browser the session gets destroyed however if I close the current tab and then go back to the site, the session still exists, how can I make sure that the session is destroyed both on a tab close and a window close? ...

PHP Based session variable not retaining value. Works on localhost, but not on server.

I've been trying to debug this problem for many hours, but to no avail. I've been using PHP for many years, and got back into it after long hiatus, so I'm still a bit rusty. Anyways, my $_SESSION vars are not retaining their value for some reason that I can't figure out. The site worked on localhost perfectly, but uploading it to the se...

PHP Link to session_destroy

Hello, I need to make a link that when clicked will run this in php: session_destroy(); I know how to make a link in html, but I don't know how to make it interact with php. Thanks for any help. ...

Writing in two sessions from the same file (PHP)

Hi, I want to make it possible for the administrator to log in as a fontend user from the backend. Right now I'm using two sessions (sessions with different names), one for the admin and one for the frontend. Is it possible to write in the first session, close it and then open a new session? This is a simplified version of what I atte...

storing session data in mysql using php is not retrieving the data properly from the tables.

I have a problem retrieving some data from the $_SESSION using php and mysql. I've commented out the line in php.ini that tells the server to use the "file" to store the session info so my database will be used. I have a class that I use to write the information to the database and its working fine. When the user passes their credenti...

Allow one session only at a time

Dear all, I would like to make my website to allow only one session at a time. For example, let say user has login to my website on firefox, if the user login again to another browser like opera on the same computer or different computer, the session on firefox will be destroyed. However, the session on firefox remained if it remains a...

(PHP - Session) How can user restrict to access direcly to controller.php , only allow access from view.php?

Hi, I am a beginner in PHP. How can I restrict user access to controller.php and allow access to it only via view.php? My proposal: I don't know if this is proper, or how to avoid robots accessing it directly. view.php: <?php session_start(); $_SESSION['isFromView'] = true; ?> <html> <body> <form action="...

PHP $_SESSION Expiry

Does the $_SESSION expire at any time point? Obviously you can call session_destroy() or close the browser. I just had a application fail because it was relying on the session and the browser had been open for 2 days. I guess the session must have expired. ...

Starting global session to all pages.

How can i start a session in PHP which will be global to all my pages. I don't have access to the php.ini file. So session.auto_start = 0 in my php.ini will not be a solution for me. Thanks. ...

Preloading images in a PHP session

Hi, I am using sessions to keep track of user data. I have many pages that access the same set of images. Is there a way to preload the images into a session so that they are loaded for the rest of the session? -Mike ...

Java & PHP sessions

Hi, I'm creating a Java applet which communicate with my PHP website by requesting pages and retrieving their contents. It works pretty well and it allows my applet to use PHP sessions. However, I tried to launch the applet with Opera (instead of Firefox), and it appears that Opera doesn't let my applet use its PHP session, and as Java...

PHP sessions and cookies question.

Is PHP sessions the same as cookies? I ask this because I'm writing a privacy policy and the site uses PHP sessions, MySQL, JQuery and CSS. If Session are not the same should I change or leave the cookies name? Here is what I have so far. Cookies - The Website uses "cookies," a technology that stores a small amount of information on...

PHP login takes two attempts to work

I've got a really simple login script using PHP's sessions to limit access, but I'm having a really peculiar issue. The login always fails on the first attempt, even with correct credentials, but second and subsequent attempts work with no issues. I'm really confused as to the cause, so any help would be appreciated. the login form, wit...