This is what I did: I set pairs of expired cookies:
Func
var responseCookie = new HttpCookie(cookieName);
responseCookie.Domain = Request.Url.Host;
responseCookie.Expires = DateTime.Now.AddYears(-1);
this.Response.Cookies.Add(responseCookie);
// try also to issue an expired cookie - to 'remove it'
// like - the one before but
// with the base domain. That is, without the sub-domain prefix.
// The cookie can only be deleted
// if the domain in the response matches exactly that
// assumed by the browser.
var responseCookie2 = new HttpCookie(cookieName);
responseCookie2.Domain = getBaseDomain(Request.Url.Host);
responseCookie2.Expires = DateTime.Now.AddYears(-1);
this.Response.Cookies.Add(responseCookie2);
No comments:
Post a Comment