This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Session timeout and ajax calls
Session timeout and ajax calls [message #99947] Thu, 27 May 2010 16:47 Go to next message
Julien  is currently offline Julien
Messages: 2
Registered: January 2007
Location: Paris
Junior Member
Greetings,

I would like to detect the timeout of a session in order to
- save the work of a user
- unblock the elements he was working on, as soon as possible
- inform the user of the timeout (and/or redirect to the expiration page)

If i make a periodic call (jq_remote_function) it restarts the timer for the session and prevents the timeout.

I need a new angle and any help would be appreciated.
Thank you
Re: Session timeout and ajax calls [message #99958 is a reply to message #99947 ] Thu, 27 May 2010 19:50 Go to previous messageGo to next message
xplo  is currently offline xplo
Messages: 428
Registered: September 2008
Faithful Member
php being a stateless language (i read that somewhere long time ago , not sure ...) you cannot trigger an event when the session is being deleted :/

However anyone feel free to prove me wrong because i d like to track that too ~
Re: Session timeout and ajax calls [message #100007 is a reply to message #99947 ] Fri, 28 May 2010 14:55 Go to previous messageGo to next message
Julien  is currently offline Julien
Messages: 2
Registered: January 2007
Location: Paris
Junior Member
Thanks for your reply

I know it can't be solely a PHP solution
I'm looking for a way to track the PHP session from outside... or simulate the timeout in javascript

No luck for now Wink
Re: Session timeout and ajax calls [message #102105 is a reply to message #100007 ] Wed, 07 July 2010 04:38 Go to previous messageGo to next message
silent_hill_dev  is currently offline silent_hill_dev
Messages: 56
Registered: December 2009
Location: Argentina
Member
I think it would be much easier to just save the work periodically with an AJAX request while the user is working, which in turn would refresh the timer of the session.
Re: Session timeout and ajax calls [message #102573 is a reply to message #99947 ] Fri, 16 July 2010 11:09 Go to previous message
jonavogt  is currently offline jonavogt
Messages: 3
Registered: April 2010
Junior Member
You could set a timeout time using a timestamp. Then periodically call a function using javascript which checks for timeout.

In case the user just quits the browser, you should do some kind of cronjob checking or globally check with each request made (performance!).

If the user does a normal request, reset the timeout time to now + x.
Previous Topic:schema.yml relation type problem
Next Topic:web site symfony google map ?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software