View Full Version : Loosing sessionid after migrating ext2.0 to ext4.0 (different behavior between IE/FF)

19 Dec 2011, 4:37 AM

we have recently migrated our web application from extjs 2.0 to extjs 4.0.7.
After changing and adapting code to the new version it seems that it works perfectly but actually not.
Our application is JEE application:
EXTJS -> Ajax/JSON -> Struts 1.x -> EJB 2.x ->etc...
Before migrating it worked perfectly for years.
We recently decided to migrate to ExtJS 4.0 for browser compatibility reasons, but since we have a problem.
At first connection server (WAS 7.0) detects there is no sessions and redirect to the login form, then create a JSESSIONID that is stored in a cookie by the browser.
So far everything is normal, but when we browse application (ajax request or not) then the browser is suddenly not sending JSESSIONID anymore:
- with IE it happens very often (3 or 4 requests maximum)
- with FF less often (about every 20 mins)

It seems that the information is still in the cookie but the param is not forwarded in the request. Then of course the server is forwarding to the authentication form. We use FF + Firebug and IE + WebDev. to trace request/response headers

We never faced this behavior before the migration.
Why this happen from ExtJS 4.0. Is there some thing important to know about CookieProvider?
Why do we have a different behavior between FF and IE?

If someone could help, thank you in advance.


19 Dec 2011, 5:11 AM
Mayby you can try to set this ..

Ext.Ajax.extraParams = { jsessionid: Ext.util.Cookies.get('jsessionid') } ;

19 Dec 2011, 5:11 AM
Spontaneously no clue why the browser act differently.

Take a look at:

you can add your session id directly to the ext.ajax class to make sure it will get passed with each request.

19 Dec 2011, 8:16 AM
thank you for your help and suggestions,
I finally figured out what is the problem,
Forcing extraparams in Ajax request wouldn't have resolved my problem because:
- I had the problem with "regular" request like a panel content loading as well,
- the jsessionid param actually disappeared from the cookie!

In deed, we used the Ext.state.CookieProvider to store some application context information in a cookie. And it seems that the implementation from ExtJS 2.0 to ExtJS 4.0 changed in a way that all the previous information stored in the cookie are removed when writting a new one, that's why I lost my jsessionid, while browsing the app.

We changed for LocalStorageProvider implemetation that solved the problem.

It seems too that this implementation depends also from the browser (as expected) and can explain the different behavior from browsers.

Thank you for your quick support