...

session timeout.

muddu_shafi
08-20-2010, 11:26 PM
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 :rolleyes:

Gjslick
08-21-2010, 06:52 AM
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

muddu_shafi
08-23-2010, 02:49 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum