note 42132 added to ref.session
| From: | Afternoon at rn2 dot php dot net | Date: | Tue, 04 May 2004 16:28:20 +0000 |
| Subject: | note 42132 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69210@lists.php.net to get a copy of this message | ||
I found a good solution to create a persistent session by storing a persistence flag, ironically, in
the session itelf. I start the session (which sends a Set-Cookie with no expiry time), read the flag
and then, if the user wants a persistent session, stop and restart the session with the expiry time
set using session_set_cookie_params, which then sends a cookie with a good expiry time. This
solution has been quickly tested with all major browsers and seems to work.
I have outlined the whole process in my blog: http://aftnn.org/journal/508
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42132
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42132&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42132&report=yes
Search -- http://master.php.net/manage/user-notes.php