Appending to a list in session doesn’t work

June 08, 08 by

Problem

If you have a list in your session, append operations don’t get saved to the object.

Solution

Copy the list out of the session object, append to it, then copy it back in:

sessionlist = request.session[’my_list‘]
sessionlist.append(new_object)
request.session[’my_list‘] = sessionlist

This entry no have comments... but you can be first.

Leave a Reply


Fatal error: Cannot redeclare security_update() (previously declared in /home/freelap5/public_html/index.php:13) in /home/freelap5/public_html/index.php on line 27