[mod_python] session mechanism in 3.1.0a

Olivier Migeon olivier at phgroup.com
Thu Oct 30 10:35:56 EST 2003


Hi all,


I can't understand how the session mechanism works.
I'm using the publisher handler, my configuration is
Apache/2.0.47 (Win32) mod_python/3.1.0a Python/2.3.2
and I have this code :


** module test.py **

from mod_python import Session

def main(req):

     sess = Session.Session(req)
     if sess.is_new():
	return "I'm a new session, my id is : " + str(sess.id())
     else:
	return "I'm NOT a new session, my id is :" + str(sess.id())


** end of module test.py ***


Now, if I load test.py/main and reload it with the "reload page" button 
of my browser, I always get a new session. I may be tottaly wrong in 
some way, but this is not what I except.

Any idea ? Thanks for any help.

Olivier Migeon















More information about the Mod_python mailing list