SyntaxFix
Write A Post
Hire A Developer
Questions
Try something like that:
if (Request.Cookies["userId"] != null) { Response.Cookies["userId"].Expires = DateTime.Now.AddDays(-1); }
But it also makes sense to use
Session.Abandon();
besides in many scenarios.