Hello,
I'm working for the first time on sessions with django and I'm facing
a strange behaviour.
on my main view, I do a del request.session['entity']
On my subviews, I set request.session['entity'] = 1 (for example)
After that, for any view, I do:
if request.session['entity']:
context['entity'] = request.session['entity']
and finally, I render the template through:
return render_to_response('page.html', context,
context_instance=RequestContext(request))
So, when I first come to the page, the template does not find and
entity defined.
When I switch to my 'subviews' the entity is correctly set.
However, when I switch back to the main view, it is correctly removed
from the request.session (dump within the view confirms it) but the
template would still see the latest entity that has been set,
regardless of how time I refresh the main view.
Could someone point me the right way to remove a session variable ?
Thanks,
Xavier.