Our issue comes in the questionaire portion of the application.  There
are several questions on appl and it may take the user a while to
enter their responses.  Of course, if they do not submit the form, we
cannot save their session data.  So if they take longer than the
session timeout, their (and our) loss of answer data.

While we could have them submit the form after each question (there
are at least 5 per page), this is cumbersome and no guaratee that they
will do it.  Even if we placed one question per page, it is still
possible that they would take longer than 10 minutes to finalize their
input.

So we're looking for an approach on refreshing their session in the
background.  Some sort of keep-alive tied to a timer?  In javascript?
Or is there an easier way to do this without interupting their screen?

You'll have to use Javascript:

- Put an event handler on the document's onClick and onKeyPress events (onBlur or onFocus is not enough, they could be typing in a single field for >10 minutes).

- Keep a timer in Javascript that keeps track of how long since the last time you pinged the server.

- If a click or keypress occurs and you have not pinged the server in 5 minutes, make an ajax request to the server that returns absolutely nothing (it's there just to keep the session alive), then reset the timer to the current time.

You don't have to save and restore the session to a blob, this technique will keep the session alive.

I recommend scriptaculous (http://script.aculo.us) for the ajax stuff.

Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to