Can you read a cookie set via javascript?

  • Thread starter Thread starter Darrel
  • Start date Start date
D

Darrel

I'm working on a site where the cookie is set via javascript.

I'm trying to now read it via vb.net

It appears that one can't do this. Is that true?

-Darrel
 
I'm working on a site where the cookie is set via javascript.
I'm trying to now read it via vb.net

It appears that one can't do this. Is that true?

Ah! I figured out waht was going on. I can read cookies that were set in the
same directory as my aspx page.

So if the cookie is set at the root '/', then my aspx page that is in the
root can read it. However if the cookie was set on a page in a subdirectory
such as '/subdirectory/' then I can't read it from my ASPX page.

It looks like this is an issue of javascript and how I'm setting it. It
appears the cookie is directory-centric.

off to explore...

-Darrel
 
It looks like this is an issue of javascript and how I'm setting it. It
appears the cookie is directory-centric.

Well, it appears I can set a directory for the cookie in both javascript and
asp.net by adding a 'path=/' property to the cookie.

If I then delete all cookies to remove the previous ones set per directory,
I can then grab the cookie via asp.net

Cool!

-Darrel
 
Back
Top