Session Breaking
Posted: Thu Oct 31, 2002 7:50 am
OK, I am now very frustrated indeed with PHP's session handling. It may well be my fault but I need some pointers.
I use WXP, PHP 4.2.3 and Linux and PHP too .. same problem for both.
I have a login form which posts to a login logic script. If the user is validated I set
$_SESSION["loggedin"] = $userID;
I then include the menu for logged in users. This included page checks for $SESSION["loggedin"] and if it exists shows all the links.
Each link goes to a page and the session variable is always checked.
However the first link I click no matter what it is will redirect to my login form again because it no longer can see "loggedin"!!!!!
It's driving me nuts. I have tried session_start, session_register and tried manually appending session_id onto URLs but nothing works. I tried editing my ini file too to autostart sessions but no luck.
Does anyone know why it works on a successful login but then disappears when I click another link?
Thanks!
I use WXP, PHP 4.2.3 and Linux and PHP too .. same problem for both.
I have a login form which posts to a login logic script. If the user is validated I set
$_SESSION["loggedin"] = $userID;
I then include the menu for logged in users. This included page checks for $SESSION["loggedin"] and if it exists shows all the links.
Each link goes to a page and the session variable is always checked.
However the first link I click no matter what it is will redirect to my login form again because it no longer can see "loggedin"!!!!!
It's driving me nuts. I have tried session_start, session_register and tried manually appending session_id onto URLs but nothing works. I tried editing my ini file too to autostart sessions but no luck.
Does anyone know why it works on a successful login but then disappears when I click another link?
Thanks!