Reputation: 749
Hello
A web site was developed and deployed to client. In some cases, I need to set the flag HttpCookie.HttpOnly = true
. Okay - I have done it. Next question:
Upvotes: 2
Views: 1091
Reputation: 82483
The purpose of using HttpOnly
is to prevent Javascript from accessing the cookie, primarily to prevent XSS attacks. There are decent write-ups on CodingHorror and MSDN about it.
Bottom line: if you need access to the cookie with Javascript you can not use HttpOnly.
Upvotes: 4