I want to update a Django session variable following a Javascript event (well, actually jQuery).
Do I need to do this via a POST request?
Or can Javascript and Django share session variables in some clever way, in which case can I update the session variables direct from jQuery? I’m a bit hazy on the details.
Thanks!
You can do this via Ajax. You’ll need a simple Django view that updates the session variable, which the jQuery will call:
and the JS: