[cgiapp] Possible to avoid updating session last_access time ?

Ron Savage ron at savage.net.au
Thu Mar 3 17:15:36 EST 2011


Hi Richard

If you switch to Data::Session, you can use $session -> modified(0) in
the server's code to stop the session being saved:

http://search.cpan.org/~rsavage/Data-Session-1.03/lib/Data/Session.pm#modified()

Perhaps that will suffice.

On Thu, 2011-03-03 at 20:49 +0000, Richard Jones wrote:
> Hi all,
> 
> I have an ajax function which polls the server every few minutes, 
> looking for new messages for the logged in user. Unfortunately it's 
> acting as a keep-alive for the session, as it effectively prevents the 
> idle timeout duration ever being reached. I can't set the server poll 
> frequency to a value higher than the idle timeout or it defeats the purpose.
> 
> I'm using CAP::Session & CAP::Authentication. If there is some way to 
> avoid updating the CGI::Session _SESSION_ATIME and/or the 
> CAP::Authentication AUTH_LAST_ACCESS values (not sure if both are 
> effectively keeping the session alive), that would be good - a patch or 
> an existing (undocumented) method? Maybe pass a runtime option to bypass 
> updating the atime / last_access values?
> 
> Otherwise I'll probably have to move the ajax function out of the app 
> entirely, which would be a pity as it shares a lot of the app code.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622



More information about the cgiapp mailing list