How do I set HttpOnly cookie in Django?
And is it worth the effort to prevent XSS?
How do I set HttpOnly cookie in Django?
And is it worth the effort to prevent XSS?
In Django 3.0 you can set the following cookies to True in your settings.py:
For instances, if
SESSION_COOKIE_HTTPONLY = True
Then your client-side JavaScript will not be able to access the session cookie.