Skip to main content
Participant
February 27, 2007
Question

Redirecting to session timeout page on timeout

  • February 27, 2007
  • 2 replies
  • 1063 views
Hello everyone,

This might seem like a rather simplistic kind of question but what I am trying to do is this:

When a session timeout occurs I would simply want CF to redirect to a page that simply states that the session has timed out. My initial approach is to use onSessionEnd and use <cfinclude> or the <cflocation> tags to try to load the notification page back up. I have a session timeout of 30 minutes.

Thus far, I have had no luck. What happens right now if I leave a page inactive so that it exceeds the timeout period is nothing. The session variables timeout because once I refresh the page it takes me back to the login page. So I know the session is timing out just fine. But again, I want it to display a page simply stating that the timeout has occurred and an option to log back in. Is this the wrong approach or am I missing something?

Here are the code snippets:

    This topic has been closed for replies.

    2 replies

    February 28, 2007
    This site has a good info on the JavaScript refresh.

    JavScript Refresh
    February 27, 2007
    The page has rendered and is sitting on the client's browser, with time ticking by. The ColdFusion Server has long since disconnected and has no clue as to what's going on on the client.

    So you are going to have to look for a client-side solution. I recommend the REFRESH metatag, although you could easiely do it in JavaScript. The following will redirect after 1800 seconds (30 minutes) - <meta http-equiv="REFRESH" content="1800;url=http://myPath/myTimeoutPage.cfm">