[Django]-Django : When is sessionid cookie set ? [ Is it available by default ? ]

8👍

The default behavior is to only populate the session if you access or modify a key in the session dict-like object.

To avoid this behavior set SESSION_SAVE_EVERY_REQUEST to True in your settings.py file. This makes sure that a session is saved on each request, even if you didn’t modify the session object.

The authentication middleware has no bearing on sessions; by default django supports anonymous sessions.

Leave a comment