note 19409 added to function.session-set-cookie-params
| From: | gavin_spam at skypaint dot com | Date: | Tue, 26 Feb 2002 19:58:07 +0000 |
| Subject: | note 19409 added to function.session-set-cookie-params | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27084@lists.php.net to get a copy of this message | ||
The first argument to session_set_cookie_params is the number of seconds in the future (based on the
server's current time) that the session will expire. So if you want your sessions to last 100
days:
$expireTime = 60*60*24*100; // 100 days
session_set_cookie_params($expireTime);
I was using time()+$expireTime, which is WRONG (a lot of the session_set_cookie_params() examples I
found get this wrong, but probably don't care because they are just doing "infinite"
sessions).
--
http://www.php.net/manual/en/function.session-set-cookie-params.php
http://master.php.net/manage/user-notes.php?action=edit+19409
http://master.php.net/manage/user-notes.php?action=delete+19409
http://master.php.net/manage/user-notes.php?action=reject+19409