log out (clear session)

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
suthie
Forum Commoner
Posts: 68
Joined: Sat Jun 09, 2007 10:46 am

log out (clear session)

Post by suthie »

I have a whole user system made, and I keep people logged in with two session variables:

areyouin (checks to see if a user is logged in at all)
user (name of user if areyouin = true)

how can I make a logout script?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

A simple

Code: Select all

$_SESSION = array();
will clear the user session
suthie
Forum Commoner
Posts: 68
Joined: Sat Jun 09, 2007 10:46 am

Post by suthie »

thanks!
Post Reply