Skip to main content
Inspiring
March 3, 2012
Answered

Accessing Application.SessionTimeout

  • March 3, 2012
  • 2 replies
  • 1105 views
<cfoutput>
  #Application.SessionTimeout#
</cfoutput> 

results in

Element SESSIONTIMEOUT is undefined in APPLICATION.

Why?

-Didi

    This topic has been closed for replies.
    Correct answer BKBK

    Didi, you are almost there. It's the Application.cfc.

    Put the following code in Application.cfc, for example, after the settings this.sessiontimeout=...; this.applicationTimeout=...; and so on.

    <cfset request.appVars = this>

    Then, run the following code on any CFM page:

    <cfset mySessionTimeout = request.appVars.sessionTimeout>

    <cfoutput>#mySessionTimeout#</cfoutput>

    Infact, you can review the rest of the public variables by running (on the CFM page):

    <cfdump var="#request.appVars#">

    2 replies

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    March 3, 2012

    Didi, you are almost there. It's the Application.cfc.

    Put the following code in Application.cfc, for example, after the settings this.sessiontimeout=...; this.applicationTimeout=...; and so on.

    <cfset request.appVars = this>

    Then, run the following code on any CFM page:

    <cfset mySessionTimeout = request.appVars.sessionTimeout>

    <cfoutput>#mySessionTimeout#</cfoutput>

    Infact, you can review the rest of the public variables by running (on the CFM page):

    <cfdump var="#request.appVars#">

    Didi3Author
    Inspiring
    March 3, 2012

    works perfect !!!

    Thanx a lot - BKBK!

    -Didi

    BKBK
    Community Expert
    Community Expert
    March 3, 2012

    How kind, Didi.

    Inspiring
    March 3, 2012

    Other than for the reason stated in the error message you mean?

    sessiontimeout is an application setting, but that does not mean it is also a variable in the application scope (those are two different things: settings & variables).  Unless you put it there.

    --

    Adam