[mod_python] Session management

Ognen Duzlevski oduzlevski at intechjanus.com
Wed Nov 2 10:11:00 EST 2005

Hi all,

I read this paragraph from the BaseSession docs:

"id is an optional session id; if provided, such a session must already 
exist, otherwise it is ignored and a new session with a new sid is 
created. If sid is not provided, the object will attempt to look at 
cookies for session id. If a sid is found in cookies, but it is not 
previously known or the session has expired, then a new sid is created. 
Whether a session is ``new'' can be determined by calling the is_new() 

Does this imply that I can do the following:

create a Session() object and it will somehow decide where to go (say 
dbm or memory)
on the next visit to the same page I should be able to do ms = 
Session.Session(req) and ms.is_new() will tell me that this session is 
not new because it was looked up (through the cookie pysid I am 
assuming) and found in the persistant storage (like for dbm or memory, 
either way)?


More information about the Mod_python mailing list