Page 1 of 1

cookie problem - using a cookie for two different folders.

Posted: Fri Mar 19, 2010 3:51 pm
by JKM
Hi there,

I'm registering a cookie at sub.myhost.com/folder1/index.php and it works great. I tried to use the same cookie for sub.myhost.com/folder2/index.php, but it doesn't work - although when I right click -> show page info -> security -> show cookies (firefox), the cookie I want to read from is listed. So why won't this work, and how can I fix it?

Thanks.

Re: cookie problem - using a cookie for two different folders.

Posted: Fri Mar 19, 2010 6:15 pm
by requinix
You answered your own question.
JKM wrote:I'm registering a cookie at sub.myhost.com/folder1/index.php and it works great. I tried to use the same cookie for sub.myhost.com/folder2/index.php
If you "register" a cookie for one folder it is only available at that folder and deeper.

Re: cookie problem - using a cookie for two different folders.

Posted: Fri Mar 19, 2010 6:26 pm
by JKM
So there isn't a way to register the cookie for two folders or for all folders at sub.myhost.com?

Thanks for your reply!

Re: cookie problem - using a cookie for two different folders.

Posted: Fri Mar 19, 2010 7:31 pm
by requinix
Yeah, it's possible.

Any reason you can't just set it for /? Why two paths?

Re: cookie problem - using a cookie for two different folders.

Posted: Sat Mar 20, 2010 1:08 am
by JKM
folder1 is IP-restricted with htaccess, but the content (except the admin content) at folder2 should be available for anyone. Could you please tell me how?

Again, thanks a lot!