Hi,

I have a question about what gets persisted when session data gets updated. 
I've read the sessions chapter of the book, and it's not entirely clear to 
me.

Say I have two keys in the session object that I'm manipulating in a view:

view1: request.session['foo'] = 'foocontent'
view1: request.session['bar'] = 'barcontent'
view1: goes off and does something that takes a long, long timer

Meanwhile some other view fires off and changes foo:

view2: request.session['foo'] = 'updateddfoocontent'

Then view2 exits, and the most recent session data gets persisted.

But meanwhile view1 still has the old copy of the session data. Eventually 
it completes whatever it was doing, and updates bar:

view1: request.session['bar'] = 'updatedbarcontent'

Question: when view1 exits and its data gets persisted, does it overwrite 
all of the session data, including stomping on view2's modification of foo? 
If so, how can I ensure that at the end of view1, what gets persisted is:

session['foo'] = 'updatedfoocontent'
session['bar'] = 'updatedbarcontent'

I'm using django 1.4 and db-based sessions.

Thanks in advance,

Spork

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ab990f4a-3714-45b5-9a6c-0595af79d964%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to