[mod_python] Persistent variable again...

Gregory (Grisha) Trubetskoy grisha at modpython.org
Tue Apr 17 10:50:07 EST 2001


On Tue, 17 Apr 2001 nineclue at bigfoot.com wrote:

> I'm trying to implement session like mechanism using mod_python. If
> interpreter is created in each processes, is there a way to make a
> variable really persistent? I think I should make some daemon that
> connects thru named pipe to get/pass session information. Is there
> any other way?

Yes, it's called cookies.

> Second, in my first posting, I've created some ugly class that is attached
> to Request object. I thought after handling of client's request, the
> request object would be deleted. Am I right? Then what happens to the
> attached class instance? If it is destructed with req object, I can save
> session data in __del__ function. If not, should I hook cleanup phase to
> save session data?

__del__ is not something you should rely on. You should register a cleanup
instead.

Grisha




More information about the Mod_python mailing list