java – tomcat中的空会话路径是什么?

前端之家收集整理的这篇文章主要介绍了java – tomcat中的空会话路径是什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我前一天读过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.

原文链接:https://www.f2er.com/java/127690.html

猜你在找的Java相关文章