Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can you read a cookie set via javascript?

Reply
Thread Tools

Can you read a cookie set via javascript?

 
 
Darrel
Guest
Posts: n/a
 
      12-28-2008
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


 
Reply With Quote
 
 
 
 
Darrel
Guest
Posts: n/a
 
      12-28-2008
> 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


 
Reply With Quote
 
 
 
 
Darrel
Guest
Posts: n/a
 
      12-28-2008
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a cookie using Cookie Module tryg.olson@gmail.com Python 2 01-08-2009 02:39 PM
Is there a way to set a cookie with CGI::Cookie objects, from anrhtml file? Xeno Campanoli Ruby 2 07-09-2008 11:07 PM
Cookie Confusion - How to Set a Cookie cbhoem@gmail.com Python 5 05-02-2008 02:56 PM
Read cookie with different cookie emilgo Javascript 0 02-13-2004 03:26 PM
Cookies set one time, I delete cookie, cookie is never set again! Phil Powell Javascript 2 09-05-2003 02:17 PM



Advertisments