Hi,
i face some problem in my code.When i logout from the application i clear session variables using the following code:
setcookie ("Loggedin", "nobody",time()+3600);
session_unregister("uname");
session_unregister("upass");
session_unregister("ugroup");
I have a relogin option that agains take me to the home page.
The problem i face is,when i relogin with the loginid it doesnot logs in for the first time. it requires 2 time login when i login with the a different id from which i have logged out.
If i tired to login withe the same id as my logout it works fine.
If am not clear,
For example i am logging with Userid as:X
logging out and again logging with X it works fine.
But with logging as Y it requires 2 times to login.
Can u please help me in this problem.
I feel the seesion variables are not cleared...
Regarding clearing of session when you logout
Moderator: General Moderators
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
if you wish all session variables to be cleared, rathe rthan use the cookie directly I woul use session_regenerate_id
NOTE Delete old session parameter not available for PHP4. (Stated in the description but thought I'd highlight it)
NOTE Delete old session parameter not available for PHP4. (Stated in the description but thought I'd highlight it)