cookie problems in asp.net. Values reverting after response.redirect
问题 I have spent sooooo many hours on this it is insane. I have a page base class which contains a "setcookie" function and this is basically this: Dim context As HttpContext = System.Web.HttpContext.Current If context.Request.Cookies(cookieName) Is Nothing Then Dim cookie As HttpCookie cookie.Value = cookieValue cookie.Expires = DateTime.Now.AddDays(7) context.Response.Cookies.Add(cookie) Else Dim cookie As HttpCookie = context.Request.Cookies(cookieName) cookie.Expires = DateTime.Now.AddDays(7)