Re: Using sessions with Flash Remoting

2007-06-16 Thread John Robinson
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

2007-06-15 Thread John Robinson
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

2007-06-15 Thread John Robinson
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

2007-06-15 Thread John Robinson
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

2007-06-15 Thread John Robinson
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

2007-06-14 Thread John Robinson
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

2007-06-14 Thread John Robinson
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

2007-06-14 Thread John Robinson
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

2007-06-14 Thread John Robinson
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

2007-06-13 Thread John Robinson
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

2007-06-13 Thread John Robinson
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

2007-06-12 Thread John Robinson
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

2007-06-12 Thread John Robinson
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

2007-06-11 Thread John Robinson
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


Using sessions with Flash Remoting

2007-06-11 Thread John Robinson
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


~|
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:280707
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: long-polling, or comet

2007-06-08 Thread John Robinson
Thanks Brian -

I've done this way back in the past using php. It worked, but I  
wanted to avoid 2 things... 1) constantly hitting the server to look  
for new data, and 2) the app feeling slow. With the example mentioned  
in my first post the app feels very very snappy.

Aside from that, does anyone know/think that I should be looking into  
something involving "event gateways" instead?

Thanks,
John

On Jun 8, 2007, at 8:12 AM, Brian Swartzfager wrote:

> I once built a chat room tool using CF and AJAX so my wife (a high- 
> school teacher) could use it to hold scheduled chat sessions with  
> her students who had study/assignment questions.  I simply had the  
> JavaScript on the client-side make a request to the server for any  
> new messages every few seconds (each request would pass in the  
> unique ID number of the last chat message displayed to the user,  
> and the request would return any messages with a higher message ID  
> number).
>
> It seems to me it's a lot less work for the server if the client  
> takes responsibility for looking for new content, but it may depend  
> on the context of how the chat tool will be used:  single chat  
> rooms with multiple participants, where the conversation is fast,  
> or numerous one-on-one chats where there may be long pauses between  
> new posts.
>
> --Brian
>


~|
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:280469
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: long-polling, or comet

2007-06-07 Thread John Robinson
Thanks Rey -

I'll look into these links this evening. So far with a little bit of  
experimentation, I've been able to make a SSAS file that simply runs  
a really long loop, and then responds when it's done. So my ideas so  
far kind of look like so:

function getEvents() {
// run query and get length of results
result = CF.query(blah, blah);
while(!result.length) {
result = CF.query(blah, blah);
}   
// if we get here, we have new events...
// run query to delete events for next request, then return results  
to client
return result;
}

I'm thinking that I can slow this down by using a timer, and only  
checking the db for new events say every 30 seconds, instead of doing  
it in the loop. The important thing though seems to be blocking the  
return until I have some data.

Does anyone see any problems with this approach? I'm guessing each  
request runs in it's own thread, so as I scale up the number of  
clients connected, this might hurt things.

Thanks,
John



On Jun 7, 2007, at 11:36 AM, Rey Bango wrote:

> John,
>
> I've not had experience with this but it does sound like some type of
> threading may help and CF8's or BD's CFTHREAD tags may do the trick. I
> know that comet is used in JavaScript client-side implementations
>
> I use jQuery for client-side work and the jQuery Ajax/JS library does
> have a plugin to work with Comet. You can find that here:
>
> http://empireenterprises.com/_comet.html
>
> This jQuery plugin also does server polling:
>
> http://www.jasons-toolbox.com/JHeartbeat/
>
> And here's an article explaining more about Comet:
>
> http://ajaxian.com/archives/comet-a-new-approach-to-ajax-applications
>
> HTH.
>
> Rey..
>
>
> John Robinson wrote:
>> Hello!
>>
>> I've been asked to develop a chat application using CF and Flash. I
>> recently finished a front-end to a project with a proprietary backend
>> that was similar but I don't have access to it, and don't know what
>> server tech. they were using. Basically, the chat client would send
>> an http request to the server and the server would hold onto that
>> request until new messages were available (or the request timed
>> out... about 60 seconds) before it responded. At that time, I'd
>> simply make a new request, where the process would repeat itself.
>> They told me this process is referred to as "long polling" or
>> "comet". I searched a bit yesterday but couldn't find anything
>> related to CF. Can anyone confirm that this is possible in CF, and
>> perhaps post a code example?
>>
>> Thanks,
>>
>> John Robinson - Flash/Flex Developer at large
>> Blog: http://jrobinsonmedia.wordpress.com
>>


~|
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:280426
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


long-polling, or comet

2007-06-07 Thread John Robinson
Hello!

I've been asked to develop a chat application using CF and Flash. I  
recently finished a front-end to a project with a proprietary backend  
that was similar but I don't have access to it, and don't know what  
server tech. they were using. Basically, the chat client would send  
an http request to the server and the server would hold onto that  
request until new messages were available (or the request timed  
out... about 60 seconds) before it responded. At that time, I'd  
simply make a new request, where the process would repeat itself.  
They told me this process is referred to as "long polling" or  
"comet". I searched a bit yesterday but couldn't find anything  
related to CF. Can anyone confirm that this is possible in CF, and  
perhaps post a code example?

Thanks,

John Robinson - Flash/Flex Developer at large
Blog: http://jrobinsonmedia.wordpress.com

~|
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:280382
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4