Re: Using sessions with Flash Remoting
Thanks again Dave, CF's scheduler looks like it will do the job, and seems more suited for what I'm doing than sessions. John On Jun 16, 2007, at 12:44 PM, Dave Watts wrote: >> Aha! That might be the ticket! Is this something built into >> CF, or are you talking more along the lines of something like >> a cron job? > > CF has a scheduler, but you can use your OS scheduler (cron, at, > whatever) > as well. Historically, there have been problems with CF's > scheduler, so I > got into the habit of using the OS scheduler instead, but I suspect > those > problems no longer exist. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > > ~| 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:281379 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Using sessions with Flash Remoting
> Aha! That might be the ticket! Is this something built into > CF, or are you talking more along the lines of something like > a cron job? CF has a scheduler, but you can use your OS scheduler (cron, at, whatever) as well. Historically, there have been problems with CF's scheduler, so I got into the habit of using the OS scheduler instead, but I suspect those problems no longer exist. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281369 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
On Jun 15, 2007, at 2:57 PM, Dave Watts wrote: >> I could do that, but the stumbling point is not really where >> to store the data, but how/where to have CF monitor these >> values and do something with them, without that CF activity >> being tied to any or all users. > > You could store the session tokens and timestamps in the > Application scope, > then on each page request from any user you could invalidate > sessions based > on timestamp values. I'm not sure that would be a good idea, though > - it > might be too much work per request. > > Alternatively, you could schedule this. Aha! That might be the ticket! Is this something built into CF, or are you talking more along the lines of something like a cron job? john ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281340 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Using sessions with Flash Remoting
Shared Objects are basically like Cookies in Flash. You can store serialized data in a small local file that can be reused down the road. The bonus is that they aren't deleted with regular cookies. You could potential implement something yourself using them, but the main issue is because you're using a socketless method to connect everyone, the complexity of handling what you want is a real pain... !k -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Friday, June 15, 2007 1:10 PM To: CF-Talk Subject: RE: Using sessions with Flash Remoting I believe that Flash has a built in method of handling this type of thing. It's called a shared object and it allows you to read and write sessions I believe. I personally haven't used it, but several Flash programmers I've worked with have suggested it to me. andy -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, June 15, 2007 1:58 PM To: CF-Talk Subject: RE: Using sessions with Flash Remoting > I could do that, but the stumbling point is not really where to store > the data, but how/where to have CF monitor these values and do > something with them, without that CF activity being tied to any or all > users. You could store the session tokens and timestamps in the Application scope, then on each page request from any user you could invalidate sessions based on timestamp values. I'm not sure that would be a good idea, though - it might be too much work per request. Alternatively, you could schedule this. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281321 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Using sessions with Flash Remoting
I believe that Flash has a built in method of handling this type of thing. It's called a shared object and it allows you to read and write sessions I believe. I personally haven't used it, but several Flash programmers I've worked with have suggested it to me. andy -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, June 15, 2007 1:58 PM To: CF-Talk Subject: RE: Using sessions with Flash Remoting > I could do that, but the stumbling point is not really where to store > the data, but how/where to have CF monitor these values and do > something with them, without that CF activity being tied to any or all > users. You could store the session tokens and timestamps in the Application scope, then on each page request from any user you could invalidate sessions based on timestamp values. I'm not sure that would be a good idea, though - it might be too much work per request. Alternatively, you could schedule this. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| 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:281320 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Using sessions with Flash Remoting
> I could do that, but the stumbling point is not really where > to store the data, but how/where to have CF monitor these > values and do something with them, without that CF activity > being tied to any or all users. You could store the session tokens and timestamps in the Application scope, then on each page request from any user you could invalidate sessions based on timestamp values. I'm not sure that would be a good idea, though - it might be too much work per request. Alternatively, you could schedule this. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281319 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
On Jun 15, 2007, at 11:01 AM, Dave Watts wrote: >> I tactually had a logout button in place and working for a >> while, but I figure nobody will actually use it... >> >> "A logout button... why would I use that? I'll just close the >> window and save myself the hassle." > > Maybe you could use the JavaScript onUnload event to capture logout > information? This is what I've been thinking. I'll have to read up on using JS to call a cfc or cfm "behind the scenes". > >> I also thought about updating a timestamp every time they do >> something. I have a function that they call once every minute >> so I could do an update there, but I don't see a way to have >> CF constantly monitor the db checking for outdated timestamps. > > Maybe you could store this as part of your session data, instead of > (or in > addition to) the database. I could do that, but the stumbling point is not really where to store the data, but how/where to have CF monitor these values and do something with them, without that CF activity being tied to any or all users. My current solution works in that the users are getting deleted when their session ends, but that can take up to 2 minutes. I'm now just trying to find a way to do it immediately. I think the JS solution will probably be the key. Thanks again! > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > ~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281316 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Using sessions with Flash Remoting
> I tactually had a logout button in place and working for a > while, but I figure nobody will actually use it... > > "A logout button... why would I use that? I'll just close the > window and save myself the hassle." Maybe you could use the JavaScript onUnload event to capture logout information? > I also thought about updating a timestamp every time they do > something. I have a function that they call once every minute > so I could do an update there, but I don't see a way to have > CF constantly monitor the db checking for outdated timestamps. Maybe you could store this as part of your session data, instead of (or in addition to) the database. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281269 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
Kevin - The chat comm. goes through CF as well. The process is pretty simple so far. When you join, you get added to a table and everyone else in that table gets a new row in a separate table that signifies an event (USER_ADDED in this case). Each client then calls a cfc function once per minute which just loops until that client's events row isn't empty. If it's not empty ( or it's looped for a specified timeout) it returns the recordset to the client. The client acts on the event and then sends out a new request for events. So I have a function that is being called once every minute by every client. This gives me a case where a client has issued the request, but closes the browser (unloads the flash movie) before the server has had a chance to respond. I was hoping to catch this somehow and use it to end the session, which ultimately just deletes the user and any pending events for him/her from the db. I'm going to venture a guess and say that the server doesn't know the client isn't there, and just sends the response out anyway. John On Jun 14, 2007, at 5:22 PM, Kevin Aebig wrote: > How are you doing the actual chat communication? If you're using > either XML sockets or FMS, than you can trigger the notification > from there... > > !k > > -Original Message- > From: John Robinson [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 14, 2007 2:01 PM > To: CF-Talk > Subject: Re: Using sessions with Flash Remoting > > On Jun 14, 2007, at 3:47 PM, Dave Watts wrote: > >>> Given that that is the case and I have no way of knowing the >>> browser closed, I have a function (defined in a .cfc) called >>> by flash that basically loops for a while and returns some >>> data (or it times out and then returns an empty record set). >>> As soon as I get this response, I send out a new request from >>> flash. So I'm thinking that whenever a client closes their >>> browser that they will be in the middle of this call, waiting >>> for a response. Make sense? I'm also guessing that there may >>> be an error thrown here when CF tries to return the results >>> to a client that doesn't exist anymore. Can I catch this error >>> in Application.onError and tell CF to end the session? >> >> I don't think you'll get an error here, actually. But even if you >> did, you >> don't really need to worry about killing the session, since the >> client won't >> make any subsequent requests. If you're calling this function >> frequently, >> you can set the session timeout to be very short, say five minutes. > > Actually in this case, I do need to kill the session. I'm building a > chat app. When a user leaves, I need to let the other users still > active in the chat know that this user has left. Essentially I'm > deleting them from a temp table in a db. Make sense? The only > indication I've found so far is onEndSession. I'm thinking if I get > an error, I will know the user isn't around and can force the session > to close, which should trigger my onEndSession event. > >> >>> This could probably be a new post, but what I'd really like >>> to learn is a decent way to monitor the events in >>> Application.cfc. As it stands, the browser window is closed, >>> so how do I view any trace/ debug statements coming from >>> those events? >> >> Use CFLOG to write them to a file. > > Great! Thanks! >> >> Dave Watts, CTO, Fig Leaf Software >> http://www.figleaf.com/ >> >> Fig Leaf Software provides the highest caliber vendor-authorized >> instruction at our training centers in Washington DC, Atlanta, >> Chicago, Baltimore, Northern Virginia, or on-site at your location. >> Visit http://training.figleaf.com/ for more information! >> >> This email has been processed by SmoothZap - www.smoothwall.net >> >> >> > > > > ~| 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:281267 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
I tactually had a logout button in place and working for a while, but I figure nobody will actually use it... "A logout button... why would I use that? I'll just close the window and save myself the hassle." I also thought about updating a timestamp every time they do something. I have a function that they call once every minute so I could do an update there, but I don't see a way to have CF constantly monitor the db checking for outdated timestamps. john On Jun 14, 2007, at 7:07 PM, Dinner wrote: > On 6/14/07, John Robinson wrote: > >> Actually in this case, I do need to kill the session. I'm building a >> chat app. When a user leaves, I need to let the other users still >> active in the chat know that this user has left. Essentially I'm > > You can always do something like if they click the logout button, > it logs them out, and if they're inactive for 5 minutes, it says > something like "away", and then after 10 (or whatever) you just > log them out and mark them as logged out (or not, of course- > away seems to work pretty good on it's own). > > Gives the other users useful information and takes care of the > problem of the open looped system. > > ~| 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:281265 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
On 6/14/07, John Robinson wrote: > Actually in this case, I do need to kill the session. I'm building a > chat app. When a user leaves, I need to let the other users still > active in the chat know that this user has left. Essentially I'm You can always do something like if they click the logout button, it logs them out, and if they're inactive for 5 minutes, it says something like "away", and then after 10 (or whatever) you just log them out and mark them as logged out (or not, of course- away seems to work pretty good on it's own). Gives the other users useful information and takes care of the problem of the open looped system. ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281200 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
You're right, it is onSessionEnd. I have that working. I'm going to try to see what errors I can get later tonight. And yes, you're right in that I *should* be using FMS (I'd much rather be!) but my client wants this in CF. The chat actually works pretty well so far aside from this one issue. We're working on a sort of 'long-polling' solution that is pretty snappy for the end user, which might explain why I'm making the call every minute. I might just have to live with a short timeout on the session and handle it that way (which is what I'm doing now). Either way, thanks for your help! john On Jun 14, 2007, at 5:31 PM, Dave Watts wrote: >> Actually in this case, I do need to kill the session. I'm >> building a chat app. When a user leaves, I need to let the >> other users still active in the chat know that this user has >> left. Essentially I'm deleting them from a temp table in a >> db. Make sense? The only indication I've found so far is >> onEndSession. I'm thinking if I get an error, I will know the >> user isn't around and can force the session to close, which >> should trigger my onEndSession event. > > I think you're looking for onSessionEnd, but that's not going to > help you > anyway. In an HTTP application, the server never knows when the > browser > won't make a future request. And honestly, I don't think you're > going to see > that error. You need frequent polling in a synchronous environment to > determine when a session should end, or you need to use an > asynchronous > environment like Flash Media Server. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281199 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Using sessions with Flash Remoting
> Actually in this case, I do need to kill the session. I'm > building a chat app. When a user leaves, I need to let the > other users still active in the chat know that this user has > left. Essentially I'm deleting them from a temp table in a > db. Make sense? The only indication I've found so far is > onEndSession. I'm thinking if I get an error, I will know the > user isn't around and can force the session to close, which > should trigger my onEndSession event. I think you're looking for onSessionEnd, but that's not going to help you anyway. In an HTTP application, the server never knows when the browser won't make a future request. And honestly, I don't think you're going to see that error. You need frequent polling in a synchronous environment to determine when a session should end, or you need to use an asynchronous environment like Flash Media Server. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281192 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Using sessions with Flash Remoting
How are you doing the actual chat communication? If you're using either XML sockets or FMS, than you can trigger the notification from there... !k -Original Message- From: John Robinson [mailto:[EMAIL PROTECTED] Sent: Thursday, June 14, 2007 2:01 PM To: CF-Talk Subject: Re: Using sessions with Flash Remoting On Jun 14, 2007, at 3:47 PM, Dave Watts wrote: >> Given that that is the case and I have no way of knowing the >> browser closed, I have a function (defined in a .cfc) called >> by flash that basically loops for a while and returns some >> data (or it times out and then returns an empty record set). >> As soon as I get this response, I send out a new request from >> flash. So I'm thinking that whenever a client closes their >> browser that they will be in the middle of this call, waiting >> for a response. Make sense? I'm also guessing that there may >> be an error thrown here when CF tries to return the results >> to a client that doesn't exist anymore. Can I catch this error >> in Application.onError and tell CF to end the session? > > I don't think you'll get an error here, actually. But even if you > did, you > don't really need to worry about killing the session, since the > client won't > make any subsequent requests. If you're calling this function > frequently, > you can set the session timeout to be very short, say five minutes. Actually in this case, I do need to kill the session. I'm building a chat app. When a user leaves, I need to let the other users still active in the chat know that this user has left. Essentially I'm deleting them from a temp table in a db. Make sense? The only indication I've found so far is onEndSession. I'm thinking if I get an error, I will know the user isn't around and can force the session to close, which should trigger my onEndSession event. > >> This could probably be a new post, but what I'd really like >> to learn is a decent way to monitor the events in >> Application.cfc. As it stands, the browser window is closed, >> so how do I view any trace/ debug statements coming from >> those events? > > Use CFLOG to write them to a file. Great! Thanks! > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > > This email has been processed by SmoothZap - www.smoothwall.net > > > ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281191 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
On Jun 14, 2007, at 3:47 PM, Dave Watts wrote: >> Given that that is the case and I have no way of knowing the >> browser closed, I have a function (defined in a .cfc) called >> by flash that basically loops for a while and returns some >> data (or it times out and then returns an empty record set). >> As soon as I get this response, I send out a new request from >> flash. So I'm thinking that whenever a client closes their >> browser that they will be in the middle of this call, waiting >> for a response. Make sense? I'm also guessing that there may >> be an error thrown here when CF tries to return the results >> to a client that doesn't exist anymore. Can I catch this error >> in Application.onError and tell CF to end the session? > > I don't think you'll get an error here, actually. But even if you > did, you > don't really need to worry about killing the session, since the > client won't > make any subsequent requests. If you're calling this function > frequently, > you can set the session timeout to be very short, say five minutes. Actually in this case, I do need to kill the session. I'm building a chat app. When a user leaves, I need to let the other users still active in the chat know that this user has left. Essentially I'm deleting them from a temp table in a db. Make sense? The only indication I've found so far is onEndSession. I'm thinking if I get an error, I will know the user isn't around and can force the session to close, which should trigger my onEndSession event. > >> This could probably be a new post, but what I'd really like >> to learn is a decent way to monitor the events in >> Application.cfc. As it stands, the browser window is closed, >> so how do I view any trace/ debug statements coming from >> those events? > > Use CFLOG to write them to a file. Great! Thanks! > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > > This email has been processed by SmoothZap - www.smoothwall.net > > > ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281188 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Using sessions with Flash Remoting
> Given that that is the case and I have no way of knowing the > browser closed, I have a function (defined in a .cfc) called > by flash that basically loops for a while and returns some > data (or it times out and then returns an empty record set). > As soon as I get this response, I send out a new request from > flash. So I'm thinking that whenever a client closes their > browser that they will be in the middle of this call, waiting > for a response. Make sense? I'm also guessing that there may > be an error thrown here when CF tries to return the results > to a client that doesn't exist anymore. Can I catch this error > in Application.onError and tell CF to end the session? I don't think you'll get an error here, actually. But even if you did, you don't really need to worry about killing the session, since the client won't make any subsequent requests. If you're calling this function frequently, you can set the session timeout to be very short, say five minutes. > This could probably be a new post, but what I'd really like > to learn is a decent way to monitor the events in > Application.cfc. As it stands, the browser window is closed, > so how do I view any trace/ debug statements coming from > those events? Use CFLOG to write them to a file. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281177 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
On Jun 14, 2007, at 11:12 AM, Dave Watts wrote: >> onRequest... mine looks like this, but if I leave it in >> Application.cfc, remoting fails altogether: >> >> >> >> > > You can't use onRequest with Flash Remoting or SOAP. Ok! I won't ask why, but it's one for the archives I guess :) > >> I'm also using J2EE sessions, which somewhere in the docs I >> thought it said "the session will end when the user closes >> the window" but that's not what I'm seeing. It always waits >> until the session has timed-out before ending. Am I missing >> something? > > The session ends when it times out, period. When the user closes > the window, > the session cookie which is used to associate that browser with a > session is > deleted, but the session itself still exists - the server has no > way of > knowing that the browser won't make another request. This makes perfect sense. Sadly I was reading the docs that get installed with CF, and not looking at the comments on livedocs, which explain exactly what you said. Given that that is the case and I have no way of knowing the browser closed, I have a function (defined in a .cfc) called by flash that basically loops for a while and returns some data (or it times out and then returns an empty record set). As soon as I get this response, I send out a new request from flash. So I'm thinking that whenever a client closes their browser that they will be in the middle of this call, waiting for a response. Make sense? I'm also guessing that there may be an error thrown here when CF tries to return the results to a client that doesn't exist anymore. Can I catch this error in Application.onError and tell CF to end the session? This could probably be a new post, but what I'd really like to learn is a decent way to monitor the events in Application.cfc. As it stands, the browser window is closed, so how do I view any trace/ debug statements coming from those events? Thanks, John > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > ~| 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:281149 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Using sessions with Flash Remoting
> onRequest... mine looks like this, but if I leave it in > Application.cfc, remoting fails altogether: > > > > You can't use onRequest with Flash Remoting or SOAP. > I'm also using J2EE sessions, which somewhere in the docs I > thought it said "the session will end when the user closes > the window" but that's not what I'm seeing. It always waits > until the session has timed-out before ending. Am I missing > something? The session ends when it times out, period. When the user closes the window, the session cookie which is used to associate that browser with a session is deleted, but the session itself still exists - the server has no way of knowing that the browser won't make another request. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| 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:281143 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
Woot! I finally got it working, thanks to Sean's insight. There are a few issues still that I'm not sure about.. namely: onRequest... mine looks like this, but if I leave it in Application.cfc, remoting fails altogether: I'm also using J2EE sessions, which somewhere in the docs I thought it said "the session will end when the user closes the window" but that's not what I'm seeing. It always waits until the session has timed-out before ending. Am I missing something? Thanks for all the help so far! john ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281141 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
Sean - my comments inline : On Jun 12, 2007, at 5:11 PM, Sean Corfield wrote: > On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: >> So ignoring the stuff below, can you or anyone shed some light on how >> I can set a Client or Session variable in the cfc that I'm using with >> flash, that I can use later in my onEndSession function? > > Oops, I misread your code somewhat! I never ever use client variables > so I completely missed that you're trying to use CLIENT scope here. My > bad. I honestly don't know if I need Client scope or not. Check the response I just sent to Kevin for what I'm trying to do.. essentially I need to store a variable from within my cfc that's called by flash, and when the user closes the browser window, reference that variable to do a database query. Whether I need Session scope or Client scope is a mystery to me. I used Client only because when I tied in my cfc, it didn't show up in the cookie, but when I used Client, the var showed up. > Flash Remoting should handle per-session cookies but I think if you > want to use persistent cookies, you need to use JavaScript with your > Flash app to manipulate them. If you're using J2EE sessions on your > server (highly recommended!) then regular session variables should > "just work" with Flash Remoting. I don't need persistence at all. I actually would prefer per-session in this case. I am using J2EE sessions if it makes any difference. > So if you enabled J2EE sessions and use SESSION scope instead of > CLIENT scope, you should be fine: > > output="false"> > > > > output="false"> > > > > Thanks, I'll give this a shot this afternoon!! > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281035 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
Thanks Kevin, I saw an earlier post of yours that mentioned how you didn't like using sessions with flash, and that is was a pain in the arse. Technically though, this shouldn't have much to anything to do with flash or remoting. I'm working on a chat application and have it all working except for one final thing. I store each user in a db table. When a user closes their browser window, I want to delete them from the table. Flash doesn't care (or know) that the window was closed so I'm turning to a server side solution. What I'm trying to do is store their name somewhere on the server, and then be notified when they leave. The only thing I've found so far is Sessions, and the onEndSession event. Where I'm stuck is knowing a) where to stick the variable I need when inside the cfc called by flash, b) how to get the onEndSession event to fire, and c) how to reference the variable. John On Jun 12, 2007, at 5:07 PM, Kevin Aebig wrote: > I personally don't like to use Sessions with Flash. I basically do > a CFLogin > to authenticate for the service calls, than pass back any needed > vars and > hold them in Flash. I can think of a few situations where this won't > accomplish the end goal, but for most of my projects it's worked fine. > > Cheers, > > !k > > ~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281032 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: > So ignoring the stuff below, can you or anyone shed some light on how > I can set a Client or Session variable in the cfc that I'm using with > flash, that I can use later in my onEndSession function? Oops, I misread your code somewhat! I never ever use client variables so I completely missed that you're trying to use CLIENT scope here. My bad. Flash Remoting should handle per-session cookies but I think if you want to use persistent cookies, you need to use JavaScript with your Flash app to manipulate them. If you're using J2EE sessions on your server (highly recommended!) then regular session variables should "just work" with Flash Remoting. So if you enabled J2EE sessions and use SESSION scope instead of CLIENT scope, you should be fine: -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| 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:280863 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Using sessions with Flash Remoting
I personally don't like to use Sessions with Flash. I basically do a CFLogin to authenticate for the service calls, than pass back any needed vars and hold them in Flash. I can think of a few situations where this won't accomplish the end goal, but for most of my projects it's worked fine. Cheers, !k -Original Message- From: John Robinson [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 2:57 PM To: CF-Talk Subject: Re: Using sessions with Flash Remoting Thanks Sean - So ignoring the stuff below, can you or anyone shed some light on how I can set a Client or Session variable in the cfc that I'm using with flash, that I can use later in my onEndSession function? In my onEndSession function, I have 2 arguments, 'sessionScope' and 'appScope'. Assuming I set my variable in a separate cfc using the following: how do I reference that same variable in my onEndSession function? Also, I'm still not convinced that these events (onEndSession, etc) are even firing. Can anyone provide a simple example that shows how they're supposed to work? Thanks, John On Jun 12, 2007, at 1:25 PM, Sean Corfield wrote: > On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: >> > output="false"> >> > > This stores the client.testVar in VARIABLES.client.testVar which is > essentially thrown away after the request runs. > >> Then in my cfc (or cfm file), I have a function that contains this >> line: >> > > That is setting a different variable to any of the stuff in your > Application.cfc. > -- > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280860 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
Thanks Sean - So ignoring the stuff below, can you or anyone shed some light on how I can set a Client or Session variable in the cfc that I'm using with flash, that I can use later in my onEndSession function? In my onEndSession function, I have 2 arguments, 'sessionScope' and 'appScope'. Assuming I set my variable in a separate cfc using the following: how do I reference that same variable in my onEndSession function? Also, I'm still not convinced that these events (onEndSession, etc) are even firing. Can anyone provide a simple example that shows how they're supposed to work? Thanks, John On Jun 12, 2007, at 1:25 PM, Sean Corfield wrote: > On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: >> > output="false"> >> > > This stores the client.testVar in VARIABLES.client.testVar which is > essentially thrown away after the request runs. > >> Then in my cfc (or cfm file), I have a function that contains this >> line: >> > > That is setting a different variable to any of the stuff in your > Application.cfc. > -- > Sean A Corfield -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ ~| 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:280856 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: > output="false"> > This stores the client.testVar in VARIABLES.client.testVar which is essentially thrown away after the request runs. > Then in my cfc (or cfm file), I have a function that contains this line: > That is setting a different variable to any of the stuff in your Application.cfc. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280819 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Using sessions with Flash Remoting
Thanks James. That's about what I figured. I'm trying a very simplified example but no luck... Here's what I have so far: Application.cfm Then in my cfc (or cfm file), I have a function that contains this line: Any ideas? To me it seems like none of the methods in my Application.cfc are firing at all. The directory structure looks like so: /Application.cfc /test/index.cfm Thanks, John On Jun 12, 2007, at 3:26 AM, James Holmes wrote: > Well onSessionStart and onSessionEnd must go in Application.cfc. This > will need to go in a folder somewhere above the files that your > remoting calls are hitting. I assume you're handling the cookies for > sessions somewhere in your client code? > > On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: >> I should note that I'm specifically having trouble with >> onSessionStart and onSessionEnd... basically where to put them (in >> someFile.cfc or Application.cfc or Application.cfm or?). What I >> want is to run a sql query in onSessionEnd, using the vars from the >> session (or cookie... I don't really care where they're stored, as >> long as they're unique to each user). > ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280809 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
Well onSessionStart and onSessionEnd must go in Application.cfc. This will need to go in a folder somewhere above the files that your remoting calls are hitting. I assume you're handling the cookies for sessions somewhere in your client code? On 6/12/07, John Robinson <[EMAIL PROTECTED]> wrote: > I should note that I'm specifically having trouble with > onSessionStart and onSessionEnd... basically where to put them (in > someFile.cfc or Application.cfc or Application.cfm or?). What I > want is to run a sql query in onSessionEnd, using the vars from the > session (or cookie... I don't really care where they're stored, as > long as they're unique to each user). -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280739 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Using sessions with Flash Remoting
I should note that I'm specifically having trouble with onSessionStart and onSessionEnd... basically where to put them (in someFile.cfc or Application.cfc or Application.cfm or?). What I want is to run a sql query in onSessionEnd, using the vars from the session (or cookie... I don't really care where they're stored, as long as they're unique to each user). Thanks, John On Jun 11, 2007, at 6:14 PM, John Robinson wrote: > I'm trying to use session with remoting, but not having any luck. I > simply want to store some user vars (temporary user_id) in a cookie, > and when the session ends (or hopefully, the user closes the window) > the server takes those vars and executes a query to delete that user > from a database. Could anyone point in the right direction, either > with code samples or links? > > Thanks, > john > > > ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280724 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4