Only the JSESSIONID cookie set from the first login request is not sent in subsequent requests?

I can not understand what is happening. On one of env. of my webapp (written using ExtJS 4.0) - I see that the login request completed successfully, but the subsequent request failed with error 401.

When in the browser (F12) I found a little more that the first request response header has a JSESSIONID that is set as a cookie, but the second request does not send it to the request headers. Therefore, the second query creates a new session and returns a new JSESSIONID.

In the client code where the request is sent,
Ext.Ajax.request({url:'', callback..}) - there is no explicit JSessionId setting or any cookie.

The strange part does not contain all the cookie keys, only JSESSIONID, which means that cookies are not disabled and set by the browser.

Why does the browser not send JSESSIONID? I tried this in firefox / chrome.

Also this only happens in my local env., QA env. webapp is working fine.

+6
source share
2 answers

I figured it out myself .. it was a problem http://tomcat.apache.org/migration-7.html#Session_cookie_configuration

Thanks to all the people who spent time reading my question.

+4
source

The answer given by akjain is correct. However, if someone needs a piece of code, here it is (added to web.xml ):

 <session-config> <cookie-config> <http-only>false</http-only> <secure>false</secure> </cookie-config> </session-config> 
0
source

Source: https://habr.com/ru/post/987254/


All Articles