How do I set HttpOnly cookie in Django?

Aviah Laor picture Aviah Laor · Aug 20, 2010 · Viewed 9.2k times · Source

How do I set HttpOnly cookie in Django?

And is it worth the effort to prevent XSS?

Answer

greg picture greg · Jan 19, 2011

Use

SESSION_COOKIE_HTTPONLY = True

in settings.py