to oracel,
sure the cookie-lifetime does not work when you use time()+..., because the expire-date will be calculated out of time() and the value you used for lifetime automatically when you use session_start().
grz,
Stalker
session_set_cookie_paramsDescriptionvoid session_set_cookie_params ( int lifetime [, string path [, string domain [, bool secure]]] )Set cookie parameters defined in the php.ini file. The effect of this function only lasts for the duration of the script. Thus, you need to call session_set_cookie_params() for every request and before session_start() is called.
See also the configuration directives session.cookie_lifetime, session.cookie_path, session.cookie_domain, session.cookie_secure, and session_get_cookie_params().
add a note
User Contributed Notes
stalker at ruun dot de
08-Jul-2005 06:11
to oracel,
oracel at start dot no
29-May-2005 02:58
This seems to work only if you specify a lifetime within a certain limit. I spent a while debugging this since it didn't send a proper expiration time when I used time() + 60 * 60 * 24 * 365. However if you omit time() it works perfectly.
jordi at jcanals dot net
15-Nov-2004 09:39
Something that has taken me some time to debug: session_set_cookie_params() does not work when the domain param is just a one level domain, like it was a TLD.
treeml at itree dot org
13-Aug-2003 06:13
If the server time is not properly set, e.g(it is behind the client time). Excution of the following code
Kato
05-Jan-2003 04:54
Cookies can be set with a long notation expiry time...
mail at paul-roberts dot com
22-Dec-2002 10:08
if you want/expect the session to last as long as your cookie then also see
shrockc at inhsNO dot SPAMorg
19-Jun-2002 12:19
when setting the path that the cookie is valid for, always remember to have that trailing '/'.
gavin_spam at skypaint dot com
27-Feb-2002 06:58
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:
php at mike2k dot com
09-May-2001 05:16
[Editor's Note:
| ||