Re: Cookies problem
- From: "Evertjan." <exjxw.hannivoort@xxxxxxxxxxxx>
- Date: 07 Apr 2007 18:36:50 GMT
Simon Wigzell wrote on 07 apr 2007 in comp.lang.javascript:
I have discovered that saved cookie only apply to pages loaded from
the directory in which they are set. That is, if you set a cookie from
a page in your website domain root directory then load a webpage from
a directory below the root then that page will not understand the
cookie. And vice versa - if you set a cookie in a webpage in a sub
directory of the root then it won't be understoon by pages in the
root. This is in IE anyway, I have not tried other browsers.
You are wrong.
Pages from directories "below the root" do not belong to the website,
so they normally cannot even be requested on the web.
Other subdirectory files can read the cookies having the root path '/'.
Perhaps you did not or did wrongly set the cookie path?
<http://www.quirksmode.org/js/cookies.html> says:
"Usually the path is set to /, which means the cookie is valid throughout
the entire domain."
This is a real pain! The way my website works, I have dynamic asp
pages run from the domain root directory and static html pages run
from sub directories. In this particular case I am allowing the user
to set a cookie determining the language to use, English, German or
French and I find that my pages in the sub directories are not getting
the current language value.
Any ideas?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.
- References:
- Cookies problem
- From: Simon Wigzell
- Cookies problem
- Prev by Date: Cookies problem
- Next by Date: Detecting dynamic page changes
- Previous by thread: Cookies problem
- Next by thread: Detecting dynamic page changes
- Index(es):
Relevant Pages
|