session_start(); $_SESSION = array(); if (isset($_COOKIE['PHPSESSID'])) setcookie('PHPSESSID', '', time() - 42000, '/'); session_destroy(); $return_url = 'login.php'; header("Location: http://".$_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) ."/".$return_url); exit;
All things relative to everyday programming and DBA practices, This blog will not give you the ET staff, just little remindings about how things work. Subjects are relative to databases, programming, Linux, Windows and ... you name it. I used to have a notepad onto which I put down anything I thought I might need again. Hopefully this is going to be as good as the paper with the added value of being able to paste from.
Thursday, 15 February 2007
PHP Destroying the current session completely
Here is a code snipper I got out from Janet Valade's PHP & MySQL Visual Blueprint book and this is what I use it to implement logout pages
No comments:
Post a Comment
I have had so many good people trying to promote various community oriented sites through here. Therefore all comments will first have to come through me... so I get a chance to learn about the interesting sites before you do ...