Loss of C#.net cookie regular

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

This is my source code, consult a master, why is often missing the cookie value?

HttpCookie cookieUrl = new HttpCookie("User");
cookieUrl.HttpOnly = true;
cookieUrl.Expires = DateTime.Now.AddDays(1);
cookieUrl.Values["BackUrl"] = backUrl;
cookieUrl.Path = "/";

These two methods are tried, are not normal, normal, a few minutes is not, sometimes the user login, immediately suggested that unknown,

HttpContext.Current.Response.Cookies["User"].HttpOnly = true ;
HttpContext.Current.Response.Cookies["User"].Expires = DateTime.Now.AddDays(1); //1 days overdue
HttpContext.Current.Response.Cookies["User"].Values["BackUrl"] = backUrl;
HttpContext.Current.Response.Cookies["User"].Path = "/";

Please master advice, thank you!
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Josephine at December 13, 2013 - 10:28 PM