Im having trouble creating a basic timer that throws users
out to the logout
page after a certain amount of inactivity, Its set to one
minute at the
moment. I want to place this code on the top of certain
pages. Im having all
sorts of trouble with the conditional code and the functions.
At the moment the page executes but my conditional code is
ignored. I cant
seem to validate the client.timeout variable. I've tried the
function that also hasnt worked for me. The logic is that
when users request
a page the timeout variable is compared to the current time.
Can anyone help please.
<!----See if the client variable had been set from a
previous load of the
<!-----If variable isdefined calculate how long since
<cfif datecompare(client.timeout, now(), n) EQ -1>
send away to logout page and kill cfid and cftoken
keep the user active
<!--- CF will not set the client cookies automatically, so
set them manually
as per-session cookies --->
<cfif not IsDefined("Cookie.CFID")>
<CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="5">
<CFCOOKIE NAME="CFID" VALUE="#SESSION.CFID#">
<CFCOOKIE NAME="CFTOKEN" VALUE="#SESSION.CFTOKEN#">
<!---Code to delete existing session CFIF and
"Sabaidee" <firstname.lastname@example.org> wrote in
> why don't you use session management in yuor
application.cfm/cfc for this?
> you can set sessiontimeout parameter there.