[mod_python] how do i share variables accross requests?

Jean-Philippe Barrette-LaPierre jpbarrette at savoirfairelinux.net
Thu Aug 26 11:33:57 EDT 2004

Hash: SHA1

On August 26, 2004 12:12 pm, R. Pelizzi wrote:
> You probably have encountered this feature in other application
> frameworks... i remember i was using it in ASP, it was called the
> Application Object. You could store variables (ints, strings, objects)
> in it and every request could read and write them thread-safely. A
> simple example using this feature would be a user-online counter.
> Every request would check if the session is new. If it is, increment the
> counter and register a cleanup function for the session to decrement it.
> Now, how do i implement it in python?
> global variables, as far as i've understood, are not global to the
> server, just to the child process spawned by the server, so they cannot
> be used.
> Do i really have to pickle what i want to share and write it on disk
> using dbm, mysql or such? Wouldn't this be terribly inefficient,
> pickiling and unpickling every request?
> Does anybody have already implemented something similar and can post the
> code?

for session management see:
for "persistance" accross sessions see:
> Thank you
> Riccardo
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

- -- 
Jean-Philippe Barrette-LaPierre
Maintener of curlpp
Version: GnuPG v1.2.4 (GNU/Linux)


More information about the Mod_python mailing list