PDA

View Full Version : Managing HTTP Requests on Stores, TreeLoaders and Ajax Requests



j-joey
14 Jun 2010, 1:46 PM
Hi,

I have a couple JsonStores, GroupingStores and a couple TreeLoaders. And some Ajax Requests on button handlers. On back-end i'm using a specialized session manager that changes session id on each request. So simultaneous requests breaks the session.

To prevent it, i'm using beforeload & load handlers to suspend requests if there is an active one for each request-maker. Is this a good way?

I'm looking for a centralized way to manage all http requests. Is there a base class that makes those requests?

If there is, i can extend it to suspend requests if there is an active one.

or, Is there any other approaches that i should consider without altering my session management?

thanks already...

CrazyEnigma
14 Jun 2010, 6:02 PM
My question would be, why do you need this? What is the reason behind changing the session id? This poses some serious issues with the crux of AJAX which is asynchronous. XHR or XmlHttpRequest which is part of the core Javascript allows you to do synchronous calls.

Older techniques forced the client to manage all information for it's session, that is another alternative, but might be cumbersome to manage, and also poses some issues when trying to synchronize the request.

I believe that each call uses Ext.data.Connection. I am not too sure, but someone asked about making a call synchronous as well. So try doing a search on that. I believe Condor wrote a response on this.

j-joey
14 Jun 2010, 11:32 PM
thanks for your reply enigma.

right now, i'm facing those serious issues you mentioned.

i actually hate this session behavior. its purpose is preventing session attacks and it's not my implementation and my plan is to change the behavior to "change id only on fingerprint mismatch" in the future. but, for now, i'm stuck to it.

i'm going to look into Ext.data.Connection.

thanks