Cookie vs jsessionid url token precedence

a 夏天 提交于 2019-12-05 04:25:58

问题


how is it with Set-Cookie: VS jsessionid url token precedence ?

Apache Tomcat just seem to ignore the token if cookie is set. Isn't it a little inconvenient behavior ? Or is it like this because of security reasons ?

this is the url of the request in servlet

....someParam=addFile;jsessionid=7A6ECCF009D4855821BCB45E0B744A7B'

and ID of the resulting Session corresponds to the cookie request header param...

This means, that it screws up handling of the request. For instance Spring-mvc resolves someParam value to addFile;jsessionid=7A6ECCF009D4855821BCB45E0B744A7B' and it crashes with exception...


回答1:


As per the Servlet 2.4 specification, URL re-writing is the lowest denomination of session tracking so I'm not surprised that jsessionid in the URL is ignored for clients who are accepting cookies. Read the section 7.1 for relevant details (i.e. session tracking).

As far as your updated question is concerned (Spring MVC related), there are a lot of articles/techniques out there which mention how to do away with the excessive baggage of ;jsessionid in your URL by stripping them off using a filter or by using mod_rewrite. Do a google search for "jsessionid in url" and read through the links which follow.



来源:https://stackoverflow.com/questions/5868448/cookie-vs-jsessionid-url-token-precedence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!