Problem writing cookie when supplying Path property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I've been having problem writing a cookie. Everything goes ok but when I
supply the .Path property to "/" It just write the cookie when there is no
cookie present, but when I try to update the cookie (or overwrite the cookie)
it doesnt change it.


My requirement to supply the path to "/" because ASP.NET reads it. If I
write the cookie without supplying the path, the ASP.NET pages are unable to
read the cookie.


Any help on this would be appreciated.

Thanks in advance,

Syed Ghayas
 
Can you show us the code you're using to write the cookie as well as the
code you're using to update it and read it?

Ray at work
 
Thanks for your interest.Here is the Code in ASP
ASP Code:
Response.Cookies("MyCookie")("Value")="ASP Cookie"
Response.Cookies("MyCookie").Path = "/"

here I am reading that cookie

..Net Code:
HttpContext.Current.Server.UrlDecode(Request.Cookies["MyCookie"]["Value"]);

Problem occur when I update cookie in ASP, and if I didn't mention the Path
of the Cookie ASP updates the cookie but .Net return null.
 
Back
Top