session information in cgi scripts

James Gregory james at
Mon Mar 31 14:27:14 CEST 2003

On Fri, 2003-03-28 at 20:29, robin wrote:
> James Gregory <james at> wrote:
> >Simple qn: Is there a module that implements session data? Or rather,
> >what is the module that implements session data? I'm using python as a
> >CGI so storing stuff in my own webserver isn't really an option. I
> >looked on and nothing leapt
> >out at me.
> You could try my Wasp:


I managed to get my own session module to work eventually. The problem
was that I was opening the file to send the pickled object to in the
destructor of the class, and neglecting to close the file. I had assumed
that when the file object went out of scope at the end of the
destructor, the file would be closed by virtue of it's destructor being

I'm still not entirely sure why what I did changed things. I'm new to
this so for now I'm just assuming there are some rules about destructors
that I don't know. I'll look into it more when there's a bit less
pressure here :)


More information about the Python-list mailing list