ASHXハンドラーでCookie値を取得する方法はありますか?
ページにCookieを設定し、それをashxで取得したいと思います。私のクッキーは常にnullです。
このようにクッキーを保存します
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"]);
申し訳ありませんが、それは私のせいでした。私のハンドラーはサブドメインにありました。