Helpful Information
 
 
Category: ASP Programming
Cookie.Path

Hi,

I'm writing an ASP validation script that uses a cookie that is created by a user validation page and has a single value. This site will be used only under Internet Explorer 5 and more recent.

My problem is that the page called after the cookie creation can't read the cookie unless I set the Cookie.Path attribute to "\". All the documentation that I found about it is very brief, don't explain how it really works and if there's any kind of "side effects". An even stranger fact is that some people of my team can read the cookie without setting the Cookie.Path attribute.

Can anyone tell me how the Cookie.Path really works or witch browser settings make it needed (or not)?

Thanks in advance,

Molina.

By default, a cookie can only be accessed and read by web pages that are in the same directory as the page that set the cookie. So if you set a Response.Cookie("User") in:

http://www.fred.com/bloggs/users/

you won't be able to Request.Cookie("User") from a page in another directory, e.g.:

http://www.fred.com/bloggs/

If that isn't your problem, then it's probably the cookie/privacy policy on your browser.

Niki

Hi, Niki!!!

The problem was solved by a coleague.

Thanks a lot for your time!!!

Molina.



By default, a cookie can only be accessed and read by web pages that are in the same directory as the page that set the cookie. So if you set a Response.Cookie("User") in:

http://www.fred.com/bloggs/users/

you won't be able to Request.Cookie("User") from a page in another directory, e.g.:

http://www.fred.com/bloggs/

If that isn't your problem, then it's probably the cookie/privacy policy on your browser.

Niki










privacy (GDPR)