The jQuery team did a complete rewrite of the ajax() method in 1.5. That's
probably where your issue is coming from.

http://blog.jquery.com/2011/01/31/jquery-15-released/

-----snip-----
AJAX REWRITE
Perhaps the largest change is that a call to jQuery.ajax (or jQuery.get,
jQuery.post, etc.) now returns a jqXHR object that provides consistency to
the XMLHttpRequest object across platforms (and allows you to perform
previously-impossible tasks like aborting JSONP requests).
-----snip-----



andy

-----Original Message-----
From: Steve Milburn [mailto:scmilb...@gmail.com] 
Sent: Friday, March 18, 2011 1:28 PM
To: cf-talk
Subject: jQuery and Session Timeout


Hello all (sorry if this is posted twice...)

I've been using the technique detailed in a blog post by Ray Camden
(http://www.coldfusionjedi.com/index.cfm/2010/9/8/Example-of-handling-sessio
n-time-outs-in-an-Ajax-application)
to detect a session timeout during an ajax request and take
appropriate action.  This has been serving me well, but now that I'm
starting to have some problems with it I'm realizing how little I
actually know about how it works.

Let's start with the first issue.  I've been using this technique with
jQuery 1.4.2.  Since upgrading to version 1.5.1 I cannot seem to get
the statusText of the XMLHTTPRequest response to be anything other
than "error", regardless of whether there was an actual error or
whether the session timed out.  If I load jQuery 1.4.2 and run the
page, the response statusText is "SessionTimeout" (once the session is
actually timed out, of course).  However, if I load jQuery 1.5.1 on
that page, the response statusText is always "error" (again, once the
session is timed out - everything works perfectly until then).  And
since my code is looking for the statusText = "SessionTimeout" to
handle an expired session, the user is not notified that their session
is expired.

Relevent CF code here - http://pastebin.com/xPFaX4fx

jQuery code here - http://pastebin.com/CAJDve0k

As you can see in the js code, I'm dumping the XMLHTTPRequest object
to the console so I can see the contents.  I've noticed the contents
vary by more than just the statusText from 1.4.2 to 1.5.1.  Is this
just the nature of the beast with jQuery 1.5.1, and I have to find
another way to handle expired sessions when making ajax requests?

BTW - I'm running CF8.  There is also an issue that is discussed in
the comments of that blog post and detailed in a subsequent post by
Ray regarding the status of Robust Exception Information in the CF
administrator.  That brings up another issue for me that I can address
later, but for now I have that enabled.

Thanks for any help.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343130
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to