I tried using several mechanisms, including the jquery cookie plugin. When I try to read this cookie, I always get an empty result. Chrome's Developer Console shows that the sessionid cookie is indeed set. However, there's a checkmark for the HTTP column for that cookie, which is different than the other cookies. I'm developing on my localhost, if that makes a difference.
It's a HTTP-only cookie; they cannot be read by JavaScript.
http://en.wikipedia.org/wiki/HTTP_cookie#Secure_and_HttpOnly
It's explained in the documentation about sessions:
https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cookie-based-sessions
The behavior can be changed by setting SESSION_COOKIE_HTTPONLY
to false (but that is not recommended; see link above).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With