note 44605 added to function.session-set-cookie-params

From: Date: Tue, 10 Aug 2004 22:19:55 +0000
Subject: note 44605 added to function.session-set-cookie-params
Groups: php.notes 
Request: Send a blank email to php-notes+get-74425@lists.php.net to get a copy of this message
There is a bug I had in PHP4/5 : if you want to delay the SID cookie storing you should be able to do it with : <? session_name("sess"); session_set_cookie_params(time()+3600); session_start(); ?> Unfortunately this code don't work properly : there is a slight problem in those functions. What you need for fixing it is to use this code <? session_name("sess"); session_start(); setcookie ("sess",session_id(), time()+3600,"/"); ?> instead. Don't ask me why but it works then. (i tested it on apache2/php5/win32) Moreover, it seems to fix a bug I had in apache2/php4/red hat linux that makes i didn't get any session. Hope it relax your nerves ;) ---- Manual Page -- http://www.php.net/manual/en/function.session-set-cookie-params.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44605 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44605&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44605&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74425) next »