note 44605 deleted from function.session-set-cookie-params by aidan

From: Date: Wed, 11 Aug 2004 14:03:19 +0000
Subject: note 44605 deleted from function.session-set-cookie-params by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74438@lists.php.net to get a copy of this message
Note Submitter: contact@tcknetwork.com ---- 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 ;)

« previous php.notes (#74438) next »