problem with setting cookie expiry date

M

Milsnips

Hi there,

I don't know why its not working for me, here is the code I am using:

Response.Cookies["TestCookie"].Value = "Cookie is set";
Response.Cookies["TestCookie"].Expires = DateTime.Now.AddYears(30);
Response.Redirect("cart.aspx");

then it redirects to the cart page where i read the cook which it can see,
however the date is set to 01/01/0001 00:00:00... but in debug mode when i
checked Response.CookiesResponse.Cookies["TestCookie"].Expires - it shows
todays date + 30 years as it should be.

Any help appreciated!
thanks,
Paul
 
G

Guest

Looks like you might have found a real bug to me. Same result if you use
Server.Transfer, and same if you create a new HttpCookie and populate its
properties then add to the Response.Cookies collection.

Maybe somebody else can add something.
Peter
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top