Click here to Skip to main content
15,895,011 members
Articles
Tip/Trick
(untagged)

Session time-out setting in ColdFusion

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
28 Oct 2014CPOL1 min read 12K   1  
Knowing how session time-out work in ColdFusion

Introduction:

We will know about the session timeout management in ColdFusion.

Use Cases:

Case : 1

In CF Admin Under Server Setting >> Memory Variables 

           The session timeout value was set to 30 mins

In My Application inside Application.cfc

           The session timeout value was set to 20 mins

Case : 2

In CF Admin Under Server Setting >> Memory Variables 

           The session timeout value was set to 20 mins

In My Application inside Application.cfc

           The session timeout value was set to 30 mins.

In the above 2 cases what would be the precendence of the session timeout values??
 
Answer:
      case : 1 - session timeout value would be 20 minutes
      case : 2 - session timeout value would be 30 minutes
 
Hence in both the cases the session timeout setting in CF Admin would be overwritten by the session timeout  setting provided inside Application.cfc in the Application.
 
So it is a good habit to set the Memory variables inside the Application.cfc for an Application.

 

Using the code:

C++
// code block to use session timeout value
   <cfapplication 
        name = "My Application"
        sessionmanagement = "true"
        sessiontimeout = "#CreateTimeSpan(0,1,0,0)#"
        applicationtimeout = "#CreateTimeSpan(0,12,0,0)#">

The above code in Application.cfc will et the session timeout to 1 hour and the application timeout to 12 hours.(overriding the session and application timeout values those are set in CF Admin)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Junior)
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --