Discussion:
Auto Logout Based on Session Timeout
(too old to reply)
walker25419
2005-10-23 11:29:22 UTC
Permalink
Has anyone created a function that will automatically logout an idle user when
the session timeout has been reached? Within the new Application framework of
CF7 I would think this would be easy, but I can't figure it out. My bank
website sends me to a new page that allows me to reinitialize my session or
continue with a logout. - this would be ideal.
BKBK
2005-10-23 17:25:17 UTC
Permalink
... Has anyone created a function that will automatically logout an idle user
... when the session timeout has been reached?
You will achieve that simply by enabling session management and giving the
sessiontimeout attribute a non-zero value using the function,
CreateTimeSpan().
walker25419
2005-10-23 19:39:35 UTC
Permalink
That's what I thought however, both on CF 6.1 and 7, if the user is idle all I get is a session is invalid error. No redirect back to the login page and the user has to close the browser and reopen.
BKBK
2005-10-24 12:03:58 UTC
Permalink
... CF 6.1 and 7, if the user is idle all I get is a session is invalid error.
That is, of course, to be expected. Once the session times out, the cabbie
dies;
there's no longer anyone to carry user to login page.
... redirect back to the login page
I wonder whether the following is possible. I've never tried it before, but it
seems
plausible. Do the redirect in the OnSessionEnd method of Application.cfc.
Ajit S. Warrier
2005-10-24 12:35:23 UTC
Permalink
What you could do is this - add code on each page so that when the session
variable does not exist, redirect to the login page using cflocation. Add the
URL of the page (with all the other variables that are required by that page)
as a name value pair so that the user can be returned there (with all the
variables required for the user to continue from there).

Hope this help.

Ajit

Loading...