> def show_foo(request): > request.session['foo'] = 'bar' > request.session.delete(request.session._session_key) > return HttpResponse(request.session['foo']) > > In [1]: from django.contrib.sessions.backends.db import SessionStore > In [2]: s = > SessionStore(session_key='61a271f29a679e45aed5a5539175670f') > In [3]: s.items() > Out[3]: [('foo', 'bar'), ('bar', 'baz')]
Wrong copy-paste: def show_foo(request): request.session['foo'] = 'bar' request.session.delete(request.session._session_key) request.session['bar'] = 'baz' # session will be saved, bringing 'foo' # back to life return HttpResponse(request.session['foo']) In [1]: from django.contrib.sessions.backends.db import SessionStore In [2]: s = SessionStore(session_key='61a271f29a679e45aed5a5539175670f') In [3]: s.items() Out[3]: [('foo', 'bar'), ('bar', 'baz')] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---