Can you read a cookie set via javascript?

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
 
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?

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
 
D

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top