Why can't I get a "sessionid" on the client side?

I enter django admin. When I open the JB Firebug console and try to print cookies with document.cookie, I only get csrftokencookies. But when I open the Firefox settings> Privacy> Delete cookie ... then I see a sessionidcookie.

How to get this on the client side?

+5
source share
1 answer

You cannot access the session cookie because it is set to HTTPOnly by default (you can see it with Firebug (Resource-> Cookies-> sessionid HTTP column))

Copying from docs :

SESSION_COOKIE_HTTPONLY
Default: True

Whether to use HTTPOnly flag on the session cookie. 
If this is set to True, client-side JavaScript will not to 
be able to access the session cookie.

: SESSION_COOKIE_HTTPONLY = False settings.py, . .

+9

All Articles