public void Delete(string key, CookieOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } // Assume you can always delete cookies unless directly overridden in the user event. var issueCookie = true; ApplyPolicy(key, options); if (Options.OnDeleteCookie != null) { var context = new DeleteCookieContext(Context, options, key) { IsConsentNeeded = IsConsentNeeded, HasConsent = HasConsent, IssueCookie = issueCookie, }; Options.OnDeleteCookie(context); key = context.CookieName; issueCookie = context.IssueCookie; } if (issueCookie) { Cookies.Delete(key, options); } else { _logger.DeleteCookieSuppressed(key); } }
public ActionResult LogOut() { Cookies.Delete("usuariologado"); FormsAuthentication.SignOut(); Session.Contents.RemoveAll(); return(RedirectToAction("Login")); }
public void Delete(string key) { if (CheckPolicyRequired() || Options.OnDeleteCookie != null) { Delete(key, new CookieOptions()); } else { Cookies.Delete(key); } }
public void Delete(string key, CookieOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } ApplyPolicy(options); if (Policy.OnDeleteCookie != null) { var context = new DeleteCookieContext(Context, options, key); Policy.OnDeleteCookie(context); key = context.CookieName; } Cookies.Delete(key, options); }
/// <summary> /// Delete the key /// </summary> /// <param name="key">Key</param> public void Remove(string key) { Cookies.Delete(key); }