Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-20-2010, 11:26 PM   PM User | #1
muddu_shafi
New to the CF scene

 
Join Date: May 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
muddu_shafi is an unknown quantity at this point
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
muddu_shafi is offline   Reply With Quote
Old 08-21-2010, 06:52 AM   PM User | #2
Gjslick
Regular Coder

 
Join Date: Feb 2009
Location: NJ, USA
Posts: 476
Thanks: 2
Thanked 70 Times in 69 Posts
Gjslick will become famous soon enough
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
Gjslick is offline   Reply With Quote
Old 08-23-2010, 02:49 PM   PM User | #3
muddu_shafi
New to the CF scene

 
Join Date: May 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
muddu_shafi is an unknown quantity at this point
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.
muddu_shafi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:36 PM.


Advertisement
Log in to turn off these ads.