Results 1 to 4 of 4

Thread: Prevent session timeout for long-running background tasks

  1. #1
    Join Date
    Jul 2008
    Posts
    4

    Default Prevent session timeout for long-running background tasks

    Hi all,

    I'm looking for some inspiration in how to increase HTTP session timeout constantly if a background task is still running.

    The background task is started by a web client and his state should be available to the web client while the task is running. It might be the case that the user is doing nothing until the session invalidates. Therefore the session timeout should be increased by the system.

    I'm looking for some kind of spring abstraction and don't want to set the session timeout from inside the task by doing something like httpSession.accessed().

    Has anybody an idea how I could solve that better?

    Thanks in advance!
    Last edited by jfk; Sep 25th, 2008 at 08:02 AM.

  2. #2
    Join Date
    Dec 2006
    Posts
    311

    Default

    I cant think of a better place to use ajax. You can have an ajax call executed every X minutes via javascript callback that you register when the page loads.

  3. #3
    Join Date
    Jul 2008
    Posts
    4

    Default

    Quote Originally Posted by TerpInMD View Post
    I cant think of a better place to use ajax. You can have an ajax call executed every X minutes via javascript callback that you register when the page loads.
    Thanks for your reply! The problem with this approach is, that the page with the ajax calls should stay open. In the application we develop, the user might do some other work and might then come back to the status page of the long-running process. Or he might navigate to another place in the web application and does nothing at all.

    We don't want the client to do some phantom requests, we want some kind of listener or something that checks whether any processes are still running and that keeps the session active no matter how the session timeout is configured.

  4. #4
    Join Date
    Dec 2006
    Posts
    311

    Default

    whats wrong with having the long running process keep the session active?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •