Hi guys,
I have written a small admin system for a courier firm and the client would like a "log out" button.
I use some session variables, is there a standard procedure/function/code that will achive this.
Any feedback would be appreciated.
Thanks,
Rob.
P.S. New look to forum looks fantastic!
Logging out?
Moderator: General Moderators
Re: Logging out?
Use
Code: Select all
if ($_POST['logout']){session_destroy();}
//where logout is the name of the button or you could use
session_unregister if they logout by mistake and they want login more quickly
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Logging out?
Or something like:
Code: Select all
if ($_POST['logout']){
session_start();
$_SESSION['user'] = null;
}
(#10850)
-
spacebiscuit
- Forum Contributor
- Posts: 390
- Joined: Mon Mar 07, 2005 3:20 pm
Re: Logging out?
Thanks guys - that does the job perfectly!
Rob.
Rob.