Answered
CFAPPLICATION Help Needed
Here is the situation: In short I want to set the
CFAPPLICATION SESSIONTIMEOUT and CFLOCK TIMEOUT variables
dynamically from a variable at top of my application.cfm page.
So basically something like this, which doesnt seem to be working properly:
<cfparam name="sessionTimeout" default="#CreateTimeSpan(0,0,30,0)#" />
<cfapplication name="myappname" sessionmanagement="Yes" setclientcookies="yes" setdomaincookies="no" sessiontimeout="#sessionTimeout#">
<CFERROR TYPE="EXCEPTION" TEMPLATE="access_errors.cfm" EXCEPTION="Any">
<CFLOCK TIMEOUT="#sessionTimeout#" THROWONTIMEOUT="Yes" TYPE="EXCLUSIVE" SCOPE="SESSION">
The purpose is:
1. During my custom "install tools" it will ask the user installing this app how long they wish to set their timeout for, then I intend to write to the application.cfm file.
2. I want the SESSIONTIMEOUT and CFLOCK TIMEOUT to obviously be consistant.
3. On login page I want to display the following code so before login the admin user will know how long of inactivity before it will timeout:
To protect your security you will be asked to re-enter your login details after 30 minutes without any online activity. <cfoutput>#sessionTimeout#</cfoutput>
The issue why I think this is not working properly, is when I do the code above for #sessionTimeout" onto a page, it displays as
0.0208333333333
For the timeout value.
Any suggestions? Will this work? Is my code okay but a different way needed to display "30 minutes"?
Any help on this is greatly appreciated.
So basically something like this, which doesnt seem to be working properly:
<cfparam name="sessionTimeout" default="#CreateTimeSpan(0,0,30,0)#" />
<cfapplication name="myappname" sessionmanagement="Yes" setclientcookies="yes" setdomaincookies="no" sessiontimeout="#sessionTimeout#">
<CFERROR TYPE="EXCEPTION" TEMPLATE="access_errors.cfm" EXCEPTION="Any">
<CFLOCK TIMEOUT="#sessionTimeout#" THROWONTIMEOUT="Yes" TYPE="EXCLUSIVE" SCOPE="SESSION">
The purpose is:
1. During my custom "install tools" it will ask the user installing this app how long they wish to set their timeout for, then I intend to write to the application.cfm file.
2. I want the SESSIONTIMEOUT and CFLOCK TIMEOUT to obviously be consistant.
3. On login page I want to display the following code so before login the admin user will know how long of inactivity before it will timeout:
To protect your security you will be asked to re-enter your login details after 30 minutes without any online activity. <cfoutput>#sessionTimeout#</cfoutput>
The issue why I think this is not working properly, is when I do the code above for #sessionTimeout" onto a page, it displays as
0.0208333333333
For the timeout value.
Any suggestions? Will this work? Is my code okay but a different way needed to display "30 minutes"?
Any help on this is greatly appreciated.
