[mod_python] Lost Session

Joshua Ginsberg listspam at flowtheory.net
Mon Jun 20 12:01:42 EDT 2005


req.sess.save() ?

-jag

-------------- next part --------------
A non-text attachment was scrubbed...
Name: unknown.jpg
Type: image/jpeg
Size: 1984 bytes
Desc: not available
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050620/a0f78c1c/unknown.jpg
-------------- next part --------------

Joshua Ginsberg -- joshg at brainstorminternet.net
Brainstorm Internet Network Operations
970-247-1442 x131
On Jun 20, 2005, at 9:21 AM, Jeremy Kohansimeh wrote:

> Hello,
>
>  I am having trouble recovering a session.? On the initial request, I 
> create some entries for the session and then save it (I have confirmed 
> that there is data in the session before I save it and that the save() 
> function is being called).? On subsequent requests, the session object 
> that I have created is not reinstated, instead a new one is created (I 
> have coonfirmed this with the is_new() function).? I have checked my 
> browser and there is a pysid cookie being set on the first request.? 
> Does anyone have any tips to debug this?? I am really at a loss for 
> what is going on.
>
>  Here is the code that I use to reinstate/create a session:
>
>  def handler(req, **kw):
>  ??? """handles initial requests"""
>  ???
>  ??? f = open( LOGFILE, 'a+')
>  ???
>  ??? req.sess = Session.Session( req)
>  ???
>  ??? if not req.sess.is_new():
>  ??? ??? # this is an old session, so load it up
>  ??? ??? req.sess.load()
>  ??? ??? f.write( 'old session\n')
>  ??? else:
>  ??? ??? f.write( 'new session\n')
>  ??? ???
>  ??? f.close()
>  ??? ???
>  ??? return segment.dispatchToHandler( req)
>
>  Best Regards,
>  Jeremy Kohansimeh
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python


More information about the Mod_python mailing list