web在本地除錯可以清除cookie,但是部署到服務器以后就無法清除cookie了,有沒有人遇到過類似情況怎么解決的?
清除cookie的代碼
public static void Erase(string name)
{
HttpCookie cookie = new HttpCookie(name);
if (cookie != null)
{
cookie.Expires = DateTime.Now.AddDays(-10);
cookie.Values.Clear();
HttpContext.Current.Response.Cookies.Add(cookie);
}
}
uj5u.com熱心網友回復:
core 是用 Cookies.Delete(name)uj5u.com熱心網友回復:
C#里面沒有這個呀轉載請註明出處,本文鏈接:https://www.uj5u.com/net/60535.html
標籤:ASP.NET
上一篇:ASP.NET制作音樂網站
