|
我前一天读过apache tomcat文档,我对emptySessionPath感到很困惑.据我所知,如果设置为true,则emptySessionPath将存储在Web应用程序的根文件夹中.请给出术语emptySessionPath的正确定义,如果设置为true和false会发生什么?
请指导我.谢谢.
解决方法
emptySessionPath字段仅指出是否应将所有cookie存储在根URL路径中(如果emptySessionPath = true),否则(否则).
Apache的Connector使用它.查看详细信息here(这适用于AJP Connector,它是Connnector对象的一部分).
这基本上意味着:
If emptySessionPath is enabled in tomcat,the JSESSIONID cookie is written to the root “/” path. This means that whatever webapp you are on will use the same cookie. Each webapp will re-write the cookie’s value to hold that webapp’s session id,and they are all different.
When this is enabled and servlets in different webapps are used,requests from the same user to different servlets will end up overwriting the cookie so that when the servlet is again interacted with it will create a new session and loose the session it had already set up.
If emptySessionPath is not set,there are multiple cookies in the browser, one for each webapp (none at the root),so different webapps are not re-writing each other’s cookie as above.
JSESSIONID是Webapp的ID会话.查看完整说明here.
更新:有关使用情况的信息有些过时 – 有关如何为最近的tomcat设置会话路径的更新信息,请参阅here. (编辑:安卓应用网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|