Reputation: 36166
How can I do something like this:
Request.Cookies[FormsAuthentication.FormsCookieName].Value
in javascript?
Upvotes: 1
Views: 647
Reputation: 1038840
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).
Upvotes: 6