Problem: User Closes borwser (IE) but Cookie still remains!, how can I make cookie expire on browser exit.
WebSite Technology: ASP.NET 2.0 Using C#.
RefCode:
HttpCookie LoginCookie = new HttpCookie("LoginCookie");
LoginCookie.Domain = ".xyz.com";
LoginCookie.Values["LASTVISIT"] = Request.Url.ToString();
LoginCookie.Values["REFID"]=Session["REFID"].ToString();
LoginCookie.Values["USER_ID"]=Session["USER_ID"].ToString();
// I tired -1....to +10...even tried to comment out whole line but nothing works
LoginCookie.Expires = System.DateTime.Now.AddDays(-1);
Response.Cookies.Add(LoginCookie);
Any help would be appreciated!