[mod_python] Session example and problems.

donnie jones donniejones18 at gmail.com
Thu Feb 24 15:55:22 EST 2005


Hello,

Could someone please give me an example of using the Session() 
in modpython for passing data between functions?  
I have been googling, but with no success..

The problem I am having is that each time I reload a page that calls
the function like below, it creates a new session.

def test(req):
  sess = Sess(req);
  sid = sess.id();
  if sess.is_new():
    req.write("new session %s" % sid);
  else:
    sess.load();
    req.write("%s" % sess['username']);

I am printing the session id and each time the function is loaded
I get a new session id, thus I cannot store data in the session
to use in other functions...

Thank you.
__
Donnie


More information about the Mod_python mailing list