Search code examples
sessionasp-classicsession-timeoutkeep-alive

What is the minimum necessary code to keep a session alive in classic ASP?


I have a classic ASP site that I would like the sessions to stay alive as long as the user has a page open. So I used some Javascript to periodically call a 'keepalive' ASP page to keep the session alive so the timeout is not reached.

What do I need to put in the ASP page code to make sure it renews the session timer? Can it be a blank page or do I need to hit the Session object?


Solution

  • From MSDN:

    A session automatically ends if a user has not requested or refreshed a page in an application for a specified period of time.

    Based on that description, I don't think it matters what's in your "keepalive" script, as long as the request is made.