Link to home
Start Free TrialLog in
Avatar of Mahesh Yadav
Mahesh YadavFlag for India

asked on

Cookie not expires after given time.

I am working on asp.net web application and using cookies to store the data. I want to expire the cookie when the time of the expiration reached. Here i had given the time to expire is 6 minutes after now, but it never expires untill I close the browser.

HttpCookie CurrentUserCookie;
CurrentUserCookie = new HttpCookie("CurrentUser");
CurrentUserCookie.Expires = DateTime.Now.AddMinutes(6);
Response.Cookies.Add(CurrentUserCookie);

Please advice.
ASKER CERTIFIED SOLUTION
Avatar of kovilpattiBalu
kovilpattiBalu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial