当我的web.config具有以下httpRuntime时,我的控制器无法获取Cookie .ASPXAUTH。它似乎能够抓住任何其他的cookie,有或没有周期前缀。如果我删除下面的行,它工作正常。为什么httpRuntime targetFramework =“4.5”禁用抓取.ASPXAUTH cookie?
<httpRuntime targetFramework="4.5"/>
我正在使用以下内容来获取cookie。
HttpCookie authCookie = Request.Cookies[".ASPXAUTH"];
为什么我不能抓取Forms Authentication cookie?
你在web.config中有'标签吗?如果targetFramework =“4.5”,您是否在客户端浏览器中看到名为.ASPXAUTH的cookie? –
Win
我在web.config中有身份验证模式=“窗体”>。这是一个REST服务,所以我没有在浏览器中尝试过任何东西。我知道如果我使用curl发送带有cookie的请求,控制器无法获取该cookie。 – Nikhil