Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question session timeout.

    Can anyone tell me what will be my session time out? Is it "1" hour or "45 " minutes?
    Does session timeout defined in application.cfm overwrite <cflock scope="session"> values?


    I have created webservices using Coldfusion and deployed using Bluedragon for J2EE aplication server(JBOSS).
    I specified session timeout in the application.cfm page as
    <CFAPPLICATION
    NAME="remo"
    CLIENTMANAGEMENT="yes"
    SESSIONMANAGEMENT="Yes"
    SETCLIENTCOOKIES="yes"
    SESSIONTIMEOUT="#createTimeSpan(0,1,0,0)#"
    APPLICATIONTIMEOUT="#createTimeSpan(1,0,0,0)#"
    clientStorage = "cookie">

    Inside my application I have also used <CFlock> to lock the session variables as such
    <cflock type="exclusive" scope="session" timeout="45">
    <cfset session.formhandlerList = structNew()>
    </cflock>

    Please help

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    Hey muddu. Session timeout actually has nothing to do with a cflock's timeout. Session timeout is how long a particular user can be idle (i.e. not access a page) before losing their session variables. cflock's timeout is how long the code will wait to gain the lock before throwing an error.

    Right now your session's timeout is 1 hour, and that particular cflock's timeout is 45 seconds (not minutes). Just as a note though: you don't need such a high timeout on the cflock. I usually set mine to 10 seconds, but most likely, any code that you have within a session-scoped lock inside your app will run within milliseconds (unless you somehow create a deadlocking situation).

    Hope that helps,

    Greg

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thanks

    Thanks GJSLICK,

    It helped me a lot to understand the concept. I will definitely reduce the cflock timeout, as I don't really have a deadlock situation. I did it because somewhere I read that it is a good practice to access session variables inside <CFLOCK>.
    Thanks once again.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •