Sorry to harp on about sessions

From: Date: Wed, 30 Aug 2000 14:22:09 +0000
Subject: Sorry to harp on about sessions
Groups: php.windows 
Request: Send a blank email to php-windows+get-2297@lists.php.net to get a copy of this message
Sorry folks but I still haven't got the hang of sessions in PHP 4.0 - which I am trying to use to handle login/logout. ..and my last mail reading "simply behave as the manual leads me to expect" accidentally omitted the word 'don't' ! My "welcome" page, visited after login, begins: session_start(); session_register("userUnique"); session_register("type"); hopefully beginning to keep tabs on identity of user. The opening lines of my *login* script are: if ($logout == "yes") //passed via URL from page from which user is logging out { session_unset(); session_destroy(); } echoing to screen shows the script no longer 'remembers' value of userUnique. I expect that when the *new* user logs in and is taken to the same "welcome" page, a session will start with the new value of userUnique, corresponding to the new user. Instead the script remembers the original value, which is not what I want! Sorry but I am new to this and very thick! Pablo Vera and others have shown me how to do what I want with a cookie specifically set for this purpose but surely the session cookie should do it? Quintin Quintin

« previous php.windows (#2297) next »