note 129695 added to function.setcookie
| From: | ilya@ilya.top | Date: | Fri, 09 Aug 2024 02:35:23 +0000 |
| Subject: | note 129695 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221467@lists.php.net to get a copy of this message | ||
In any web browser there is a very commonly used option "Open previous windows and tabs"
which is disabled by default, but many people enable it.
When this option is active, the web browser, when closing and reopening, instead of executing the
termination and starting a new session, saves and restores the current session along with session
cookies and sessionStorage.
Both session cookies and sessionStorage, contrary to expectations, can live for a very long time
until the user closes the tab before closing the web browser.
If you want a cookie, for example with a time offset, to be guaranteed to have a short lifetime, you
should explicitly specify this short lifetime, rather than relying on self-deletion on the session
cookie.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 94.181.30.64)
----
Manual Page -- https://php.net/manual/en/function.setcookie.php
Edit -- https://main.php.net/note/edit/129695
Del: integrated -- https://main.php.net/note/delete/129695/integrated
Del: useless -- https://main.php.net/note/delete/129695/useless
Del: bad code -- https://main.php.net/note/delete/129695/bad+code
Del: spam -- https://main.php.net/note/delete/129695/spam
Del: non-english -- https://main.php.net/note/delete/129695/non-english
Del: in docs -- https://main.php.net/note/delete/129695/in+docs
Del: other reasons-- https://main.php.net/note/delete/129695
Reject -- https://main.php.net/note/reject/129695
Search -- https://main.php.net/manage/user-notes.php