note 125589 added to function.session-destroy
| From: | greald at gmail dot com | Date: | Wed, 09 Dec 2020 20:21:35 +0000 |
| Subject: | note 125589 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215966@lists.php.net to get a copy of this message | ||
All of a sudden neither session_destroy() nor $_SESSION=[] were sufficient to log out. I found the
next to work:
<?php
setcookie(session_name(), session_id(), 1); // to expire the session
$_SESSION = [];
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.244 (proxied: 217.100.185.202)
----
Manual Page -- http://php.net/manual/en/function.session-destroy.php
Edit -- https://master.php.net/note/edit/125589
Del: integrated -- https://master.php.net/note/delete/125589/integrated
Del: useless -- https://master.php.net/note/delete/125589/useless
Del: bad code -- https://master.php.net/note/delete/125589/bad+code
Del: spam -- https://master.php.net/note/delete/125589/spam
Del: non-english -- https://master.php.net/note/delete/125589/non-english
Del: in docs -- https://master.php.net/note/delete/125589/in+docs
Del: other reasons-- https://master.php.net/note/delete/125589
Reject -- https://master.php.net/note/reject/125589
Search -- https://master.php.net/manage/user-notes.php