I think this is worth knowing because I spent quite a long time trying to debug a related issue.
This is the original post from SO. Read the whole thing. Very useful.
In short,
Whenever editing a session object, it is also required to explicitly say that the object was modified. This can be achieved like so:
This is the original post from SO. Read the whole thing. Very useful.
In short,
Whenever editing a session object, it is also required to explicitly say that the object was modified. This can be achieved like so:
request.session['xyz'] = 'xyz'or in the settings we set,
request.session.modfied = True
SESSION_SAVE_EVERY_REQUEST = True.