Re: OnSessionEnd runnning TWICE
I don't know that this is a situation where you need to lock. Are you experiencing race conditions? I would try it without the locks and see if that makes a difference. Also in this code: > > > If that is in onSessionEnd, and you are counting active sessions, shouldn't it be *minus* 1 rather than plus 1? Maybe I'm not clear on what you're going for. -- Josh - Original Message - From: "Julio Cesar Lima" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Friday, April 20, 2007 7:16 AM Subject: OnSessionEnd runnning TWICE > Hi guys, > > I'm trying to count the number of sessions, and I'm getting crazy with > this. > > I have the following code on my onApplicationStart: > > > > > then I have this on my OnSessionStart: > > > > > > and finally I have this on my onSessionEnd: > > > > > > > The onSessionEnd is executed twice. SO if I have numSessions = 4, if one > sessions expires, instead I have 3, I will have 2. :(. I place a cflog, > and logs twice. There are not cflocks nested on anything like it. > > I hope you guys can help me > > Thank you > > JC > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275945 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: OnSessionEnd runnning TWICE
I'm the only one accessing my development equipment at the moment (only one in 2 days to have as well), and the below code shows 3 connected sessions. >Julio, > >There is a much easier way to count sessions, here is some simple code >=) > > > > >sessiontrackerObj= >createObject("java","coldfusion.runtime.SessionTracker"); >activesessions = >sessiontrackerObj.getSessionCollection(application.applicationname); >nosessions=ListLen(structkeyList(activeSessions)); > > >Total Sessions : #nosessions# > > > > - Chris Peterson ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275939 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: OnSessionEnd runnning TWICE
Julio, There is a much easier way to count sessions, here is some simple code =) sessiontrackerObj= createObject("java","coldfusion.runtime.SessionTracker"); activesessions = sessiontrackerObj.getSessionCollection(application.applicationname); nosessions=ListLen(structkeyList(activeSessions)); Total Sessions : #nosessions# - Chris Peterson ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275929 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: OnSessionEnd runnning TWICE
Julio, Check out Aaron West's "ColdFusion MX 7 Login Security" tutorial in the Tutorials section of his site (http://www.trajiklyhip.com). It has solid code and examples/explanations about how to go about this task. He also has a tutorial for CF 6 as well. Steve "Cutter" Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _ http://blog.cutterscrossing.com Julio Cesar Lima wrote: > Hi guys, > > I'm trying to count the number of sessions, and I'm getting crazy with this. > > I have the following code on my onApplicationStart: > > > > > then I have this on my OnSessionStart: > > > > > > and finally I have this on my onSessionEnd: > > > > > > > The onSessionEnd is executed twice. SO if I have numSessions = 4, if one > sessions expires, instead I have 3, I will have 2. :(. I place a cflog, and > logs twice. There are not cflocks nested on anything like it. > > I hope you guys can help me > > Thank you > > JC > > ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275931 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4