tags:

views:

69

answers:

2

I create a cookie and set the Expires property to 24 hours, but in IE the expiration is set to two years. In Firefox it is set correctly. Why?

My code:

//Set a cookie to expire in 24 hours.
HttpCookie clickCookie = new HttpCookie(adId, adId);
clickCookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(clickCookie);

Thanks

A: 

This does not seem to be possible. Can you try again after erasing current cookies of IE?

JCasso
I agree, it doesn't seem possible. I tried your suggestion with no luck. It again created a cookie that expires in 2011. Thanks.
triskelion
@triskelion: still found no solution?
JCasso
A: 

What happens if you do:

clientCookie.Expires = DateTime.Now.AddHours(24);
Michael Shimmins