[Catalyst] Check session expiry without extending it

2010-03-02 Thread Steve Kleiman
Using Catalyst::Plugin::Session with Session::State::Cookie. Would like to be able to poll server if the user's session has expired WITHOUT extending the session itself. The objective is to have a javascript periodical executor check if a session is expired and redirect user to a "Your session

Re: [Catalyst] Check session expiry without extending it

2010-03-03 Thread Alexander Hartmaier
Why not return the datetime when the session expires with every page and have a client-side js that does the redirect without hammering the server? -- Best regards, Alex Am Dienstag, den 02.03.2010, 21:43 +0100 schrieb Steve Kleiman: > Using Catalyst::Plugin::Session with Session::State::Cookie.

RE: [Catalyst] Check session expiry without extending it

2010-03-03 Thread John Karr
10:03 AM To: The elegant MVC web framework Subject: Re: [Catalyst] Check session expiry without extending it Why not return the datetime when the session expires with every page and have a client-side js that does the redirect without hammering the server? -- Best regards, Alex Am Dienstag

RE: [Catalyst] Check session expiry without extending it

2010-03-03 Thread John Karr
nt MVC web framework Subject: Re: [Catalyst] Check session expiry without extending it Why not return the datetime when the session expires with every page and have a client-side js that does the redirect without hammering the server? -- Best regards, Alex Am Dienstag, den 02.03.2010, 21:43 +0100 s

RE: [Catalyst] Check session expiry without extending it

2010-03-03 Thread John Karr
hartma...@t-systems.at] Sent: Wednesday, March 03, 2010 10:03 AM To: The elegant MVC web framework Subject: Re: [Catalyst] Check session expiry without extending it Why not return the datetime when the session expires with every page and have a client-side js that does the redirect without ha

Re: [Catalyst] Check session expiry without extending it

2010-03-03 Thread Steve Kleiman
nce presumably you don't want your user's expired sessions >> hanging around in their browser. >> >> Even simpler put a refresh tag in the page with a refresh a little over the >> session timeout value, then the site's handler for expired sessions can do &

Re: [Catalyst] Check session expiry without extending it

2010-03-04 Thread Bill Moseley
On Tue, Mar 2, 2010 at 12:43 PM, Steve Kleiman wrote: > Using Catalyst::Plugin::Session with Session::State::Cookie. > > Would like to be able to poll server if the user's session has expired > WITHOUT extending the session itself. > > The objective is to have a javascript periodical executor che

Re: [Catalyst] Check session expiry without extending it

2010-03-04 Thread Peter Karman
Bill Moseley wrote on 03/04/2010 08:39 AM: > The developer explained that the AJAX session check was needed to > prevent a user from making a lot of changes in the client that could not > be saved due to a an expires session. Not sure I see the logic there. I've been solving that session-has-exp

Re: [Catalyst] Check session expiry without extending it

2010-03-04 Thread Bill Moseley
On Thu, Mar 4, 2010 at 7:05 AM, Peter Karman wrote: > > // make sure we are logged in before every xhr request > Ext.Ajax.on('beforerequest', function(conn, opts) { >if (!AIR.Auth.isAuthenticated()) { >AIR.Auth.login(); >return false; >} >return true; > }); > I though

Re: [Catalyst] Check session expiry without extending it

2010-03-04 Thread Ben van Staveren
The way I got around this was by sticking all ajax stuff in a separate controller hierarchy that would return special content based on the request and whether or not the session lived. for json it'd just return a specific flag in the object it'd throw out (which was parsed by a global callback

Re: [Catalyst] Check session expiry without extending it

2010-03-04 Thread Alexander Hartmaier
My solution is to return an error message which includes the link to the login form with Catalyst::Controller::DBIC::API. My ExtJS store class has an exception handler that shows a MessageBox with the error text: exception:function(sender, type, action, options, response, arg) { switch (type)

Re: [Catalyst] Check session expiry without extending it

2010-03-04 Thread Steve Kleiman
little over the > session timeout value, then the site's handler for expired sessions can do > the rest. > > -Original Message- > From: Alexander Hartmaier [mailto:alexander.hartma...@t-systems.at] > Sent: Wednesday, March 03, 2010 10:03 AM > To: The elegant MVC