开发者

Asp .net Forms Authentication token using pure javascript

How can I do something like开发者_运维问答 this:

Request.Cookies[FormsAuthentication.FormsCookieName].Value

in javascript?


You cannot do something like this in javascript. Authentication cookies are marked with the HttpOnly flag when emitted by ASP.NET meaning that client scripts cannot access them (and of course that's for security reasons). If there was not this HttpOnly flag you could access cookies in javascript using the document.cookie variable but as I said this doesn't apply for authentication cookies (they won't be part of it).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜