[mod_python] Sessions blocking...

Colin Fox cfox at cfconsulting.ca
Tue Apr 6 09:45:15 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I've still got the problem where using sessions causes my pages to hang.

Now that I've got "ask before storing" for cookies, I can see that the
pages that are hanging are hanging before trying to write the pysid
cookie - and that is one of the first things done for my pages.

I'm using sessions to track logins, and on each page I want to print
either "not logged in" or "logged in as:xxx". So for each page, I do:

session = session.Session(req)
if session.has_key('username'):
~    req.write('logged in as %s' % session['username'])
else:
~    req.write('not logged in')

This seems to work fine, apart from when the session hangs, which is
about 1 in 5 page loads. I can't really predict when it will happen, but
~ it is about that often.

cf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAct6boaQ1/feGlJoRAuBXAKCXOIjfPvLgJJSbBudVs78SMLBscgCeN6+k
642LkiB5O8ZepYfTiJnLuNk=
=poBi
-----END PGP SIGNATURE-----


More information about the Mod_python mailing list