note 129863 added to function.session-destroy
| From: | vitas.lowang@gmail.com | Date: | Wed, 20 Nov 2024 22:45:50 +0000 |
| Subject: | note 129863 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221662@lists.php.net to get a copy of this message | ||
I found out that in order to really have the session data cleared after calling session_destroy(),
you need to refresh the page. For example by calling
header('Location: '.$_SERVER['PHP_SELF']."?page=profile");
if you don't then there are still data in $_SESSION which was there before. I don't know
if this is intended behavior but it's kind of confusing IMO...
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 94.113.227.211)
----
Manual Page -- https://php.net/manual/en/function.session-destroy.php
Edit -- https://main.php.net/note/edit/129863
Del: integrated -- https://main.php.net/note/delete/129863/integrated
Del: useless -- https://main.php.net/note/delete/129863/useless
Del: bad code -- https://main.php.net/note/delete/129863/bad+code
Del: spam -- https://main.php.net/note/delete/129863/spam
Del: non-english -- https://main.php.net/note/delete/129863/non-english
Del: in docs -- https://main.php.net/note/delete/129863/in+docs
Del: other reasons-- https://main.php.net/note/delete/129863
Reject -- https://main.php.net/note/reject/129863
Search -- https://main.php.net/manage/user-notes.php