Question : cfapplication sessionTimeout question

Hey experts:
I have a site which uses <cfapplication> tag in an Application.cfm file.  The tag has a sessionTimeout set and it is hard-coded.  What I would like to do is make that value for the session timeout a variable which is set by an administrative type user and then loaded when the application initializes.  This would allow an administrator to reset the timeout amount.  I had what is shown below and that won't work because I'm trying to use an application variable and it's not initialized yet.  The other thing I though of was to store the value in the database and load it everytime.  I don't like that solution, particularly.  I hope this makes sense.  Is there anything else I could do?

<cfif isDefined("application.Timeout")>
   <cfset myTimeout = application.Timeout>
<cfelse>
   <cfset myTimeout = 60
</cfif>

 <cfapplication name="MyApplicationName"
      clientmanagement="no"
      sessionmanagement="yes"
      sessionTimeout = #CreateTimeSpan(0, 0, myTimeout, 0)#
      setclientcookies="no"  
      setdomaincookies="no">

THANK YOU!!

Answer : cfapplication sessionTimeout question

If the admin is going to set the value, where will you store the value he/she has chosen?  It has to be stored someplace, you can't have the admin updating your CF template.  So, you can write it to a file or you can write it to the database.   I think the database is the best option, the query (if using cfqueryparam) will take a nano second to fetch, you could run the query 50 times per request and not get a performance hit.

Random Solutions  
 
programming4us programming4us