Page 1 of 1

Weird cookie problem.

Posted: Fri Sep 10, 2010 3:39 am
by oscardog
So on a page(/dir/dir1/) I set a cookie, right after setting the cookie I echo the value out to test if it worked. It outputs the value.

I then try to use an isset() on another page (/dir/) and it returns the cookie as empty. I go into the privacy tab in firefox to view the cookies and it has my cookies stored there with the value I set.

So why when I try to use the cookie does it not work?

Edit: Well that was quick. Apparently if you set the cookie in /foo/bar/ you can only access it from /foo/bar/ and 'above'. So if you try to access it in /foo/ it wont work. Fixed by setting the option "path" parameter.