开发者

Chrome losing sessions when my Axis2 web service is accessed

Odd one this. I've got a servlet application running under Tomcat with Axis2. The application also exposes a web service (via Axis2).

Now then, Tomcat handles session management no problem, as per usual, however, when the web service is invoked, randomly, all sessions appear to be invalidated. Plus, afaik, this only happens in Chrome! The next time the Chrome client makes a request, it is handed a new session by Tomcat.

This happens after every time the web service is invoked, but d开发者_如何学Pythonoesn't affect sessions in Firefox or Safari.

Any ideas? This is extremely baffling for me.

Thanks in advance


Fixed it. Very strange result but the Axis2/web service part was a complete red herring. The problem here was that I was using another instance of Chrome to invoke the web service (using a different web app).

This second app was running on the same URL but on a different port (8080 instead of the default 80). It would seem that browsers (not just Chrome) manage sessions based on A. the domain (such as www.stackoverflow.com or localhost in my case) and B. the path (ie the name of the web app in Tomcat).

It does NOT make any distinction between domains running on different ports, hence Chrome got itself all confused when I had two windows open, one pointed to localhost/webapp and the other pointing to localhost:8080/webapp. As far as Chrome was concerned it was the same site and therefore each one kept overwriting the other's session ID.

What a mess!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜