有沒有辦法在ASHX Handler中檢索cookie值?在ASHX中檢索cookie值
我在頁面中設置了一個cookie,我想在我的ashx中檢索它。我的cookie始終爲空。
保存我的餅乾這樣
HttpCookie tokenCookie = new HttpCookie(cookieName);
tokenCookie.Values["siteGuid"] = authenticationInfo.SiteGuid.ToString();
HttpContext.Current.Response.Cookies.Add(tokenCookie);
我找回我的餅乾這樣
HttpCookie cookie = HttpContext.Current.Request.Cookies[cookieName];
return new Guid(cookie["siteGuid"]);
好抱歉,是我的錯。我的處理程序位於子域中。