Can we set HttpOnly = 'True'
via JavaScript?
document.cookie = name + "=" + value + expires + ";secure; path=/";
Thanks in advance.
Asked
Active
Viewed 320 times
0

Agent 47
- 33
- 6
-
Does this answer your question? [Set a cookie to HttpOnly via Javascript](https://stackoverflow.com/questions/14691654/set-a-cookie-to-httponly-via-javascript) – T.J. Crowder Jul 19 '21 at 09:23
-
Hi! Please take the [tour] (you get a badge!), have a look around, and read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) I also recommend Jon Skeet's [Writing the Perfect Question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) and [Question Checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). Please [**search thoroughly**](https://stackoverflow.com/search?q=%5Bjs%5D+set+httponly+cookie) before posting. More about searching [here](/help/searching). – T.J. Crowder Jul 19 '21 at 09:24