0
我在服務器端創建一個cookie如下曲奇始終返回null
HttpCookie cookie = Request.Cookies["mycookie"];
if (cookie == null)
{
cookie = new HttpCookie("mycookie");
cookie.HttpOnly = false;
cookie.Path = "/";
cookie.Values["mycookie"] = ExpressDate;
}
但每次有一個回發的餅乾失去了它的價值。任何人都可以幫忙嗎?
僅供參考:我已經嘗試過,沒有指定cookie路徑。但它也沒有工作。
你不表明你曾經把它添加到響應。 – Crowcoder