note 53833 added to function.setcookie

From: Date: Tue, 14 Jun 2005 16:59:13 +0000
Subject: note 53833 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-90423@lists.php.net to get a copy of this message
Here is something that I found out.. If your using firefox 1.04 and your using a localhost for developing your php application you may have to adjust your time value..to get the cookies to work. This does not work FireFox 1.04 and does work on IE 6.0 on localhost setcookie('csid','itworks',3600,'/'); This works in FireFox 1.04 and IE 6.0 on the localhost but it becomes a session cookie meaning the cookie deletes when the browser is closed setcookie('csid','itworks',false,'/'); as far as I can tell it only affects the localhost.. for some reason you can't add a number to expire on the localhost or add the domain field of local host if you plan to test on localhost on my domain www.phprocket.com This does work in Firefox 1.04 and IE 6 setcookie('csid','itworks',3600, '/'); Another strange thing about this. If I set the domain value setcookie('csid','itworks',3600, '/' ,'phprocket.com'); and call it like this http://phprocket.com/testcookie.php It does not set the cookie in Firefox 1.04 and it does set in IE 6 but if I call it like this http://www.phprocket.com/testcookie.php it works both on Firefox 1.04 an IE 6. I spent almost 2 hours tring to figure this out.. I hope this helps others. I have not tested any other browsers except Firefox 1.04 and IE 6 ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53833 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53833&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53833&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53833&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53833&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53833&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53833&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#90423) next »