[mod_python] What is the proper way to delete a session member

Jeff Hinrichs - DM&T jeffh at dundeemt.com
Tue May 15 09:36:14 EDT 2007


Given:
you have a session object, and there exists req.session['foo'] = bar

How do you remove/delete the member 'foo'?  I want the session to
remain except that the member 'foo' should not exist in the session
object?

Do I just set it to an empty string or None?  I could very well be
blind to this information in the docs but I couldn't seem to find it.
I recall that the session object looks like a dictionary but isn't a
true dictionary.  So I'm not sure if I can use the del method
 del(req.session['foo'])


Even a nudge to some where in the docs would be appreciated.


Thanks,

Jeff Hinrichs
www.OmahaPython.org


More information about the Mod_python mailing list