[mod_python] session variable value (partially) dissapearing

Detmar Meurers dm at ling.ohio-state.edu
Thu Mar 29 14:02:33 EST 2007


Dear Martijn (et al.),

I think I found what the problem was - and the loss of session data
apparently was related to properly saving it, as you and Graham had
suggested: For some of the possible paths through my code doing
partial page updates, the session did not get saved - i.e., I was
missing some req.session.save() calls in the sub-functions handling
those AJAX requests. 

Thanks for the replies - it's great to know there is a community one
can discuss such issues with!

Best,
Detmar

--
Detmar Meurers, Associate Professor, Dept. of Linguistics, OSU
201a Oxley Hall, 1712 Neil Avenue, Columbus OH 43210-1298, USA
http://ling.osu.edu/~dm/                 GnuPG key on web page


On Thu, Mar 29, 2007 at 02:12:11PM +0200, Martijn Moeling wrote:
    Are you properly saving the session at every request?
    Like:
    
    # Created session like this:
    # req.session = Session.Session(req)
    
    Req.session.save()
    
    Martijn
    
    -----Oorspronkelijk bericht-----
    Van: mod_python-bounces at modpython.org
    [mailto:mod_python-bounces at modpython.org] Namens Jim Gallacher
    Verzonden: Wednesday, March 28, 2007 3:00 AM
    Aan: Detmar Meurers
    CC: mod_python at modpython.org; Graham Dumpleton
    Onderwerp: Re: [mod_python] session variable value (partially)
    dissapearing
    
    Detmar Meurers wrote:
    > Hi Graham,
    > 
    > Thanks for the very quick reply.
    > 
    > The page showing the problem actually is using the publisher handler
    > (so no special exception handling etc.)
    > 
    > I tried the FileSession and the problem occurs there too - and I'm
    > not doing any calling of unlock().
    > 
    > I am calling req.session.save() - one question about that though:
    > Can it possibly cause problems when calling the save() several times
    > when handling one request?
    
    It shouldn't matter. The session store is locked so only one request can
    
    read or write at a time. This is the case even if you have session 
    locking turned off, or unlock the session manually.
    
    Jim
    _______________________________________________
    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