[SOLVED] Logout system

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

[SOLVED] Logout system

Post by S_henry »

I have a very big problem. That is about to logout the system. The problem is everytime I logout the system, I must close the browser (IE) and re-open it again to login back into the system. If not, the global session variable still hold the value of username from login before. I also have tried to point to another page to logout with put 'session_unset()' to that page. But that's still not work. Anybody can help me pls??
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

try [php_man]session_destroy()[/php_man]
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

just a tip with session_destroy() , people screw up on this all the time, make sure to include a session_start() before the session_destroy() or you will get and error ;)
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

Problem solved. Actually I just have to put session_start(). Thanks guys..
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

S_henry wrote:Problem solved. Actually I just have to put session_start(). Thanks guys..
No session_destroy()?
Include a session_destroy(), or you will maybe get some problems...
Post Reply