Problem writing cookie when supplying Path property

S

Syed Ghayas

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
 
R

Ray Costanzo [MVP]

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
 
M

microsoft.public.dotnet.framework.aspnet

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.
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top