Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public RedirectResult SignOut()
  2. {
  3. string[] myCookies = HttpContext.Request.Cookies.AllKeys;
  4. foreach (string cookie in myCookies)
  5. {
  6. var httpCookie = HttpContext.Response.Cookies[cookie];
  7. if (httpCookie != null)
  8. httpCookie.Expires = DateTime.Now.AddDays(-1);
  9. }
  10. Session.Clear();
  11. string redirectUrl = System.Configuration.ConfigurationManager.AppSettings["Path"].ToString();
  12. return Redirect(redirectUrl);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement