[Web-SIG] Session interface
gtalvola at nameconnector.com
Tue Aug 16 23:08:59 CEST 2005
Jonathan Ellis wrote:
> Still, it can be good to have a simple place to store non-permanent
I think a good use of sessions is in remembering selections that have been
made earlier on. For example, suppose you have a reporting application
where you allow the user to select one or more items to report on from a
list box, several filtering options in dropdowns or checkboxes, sorting and
grouping behavior, etc. You want to remember those settings so that if the
user returns to the report selection page, their last selected settings are
pre-selected. But, unless the user chooses to save those settings as a
"stored report", you'd like to forget the settings when the user logs out or
when they close their browser.
Also, assume that your application already has this bundle of selections in
the form of a Python object.
Isn't the cleanest, easiest, and more efficient way to handle this to simply
save the Python object in a session variable? In some cases, for example
using Webware's in-memory sessions, for example, this data never has to be
marshaled or leave the application server at all.
If I didn't have sessions, I think using either cookies or a back-end db
would be more work, less clean, and less efficient in this case.
More information about the Web-SIG