PDA

View Full Version : Cookies and directories


mouse
05-05-2003, 11:50 PM
Hi there,

How can I get a cookie to operate in another directory than that it was set from? For example use the same cookie planted in /root/blah/ in /root/.

:confused:

pardicity3
05-06-2003, 12:51 AM
Something like this I believe:


// set the cookie for the /root/ path
setcookie ("MyCookie", $value, time()+3600, "/root/");

// set the cookie for the whole domain
setcookie ("MyCookie", $value, time()+3600, "/");


You can always use http://www.php.net/manual/en/function.setcookie.php as a refrence too is you need it.

mouse
05-06-2003, 02:42 AM
Thanks for that, didn't notice it the manual :o