gpt4 book ai didi

session - JSESSIONID 和 hazelcast.sessionId

转载 作者:行者123 更新时间:2023-11-28 21:56:25 25 4
gpt4 key购买 nike

目前我们正在部署一个集群场景,我们有 3 个节点 (tomcat),所有节点都通过 Hazelcast 共享它们的 session 。我们在这些节点前面有一个 apache 作为负载均衡器。

curl我们的应用程序,我看到,使用了两个 session cookie:

1) 是带有 JSESSIONID

的普通 tomcat session

2) 是带有 hazelcast.sessionId

的 hazelcast-session

有什么方法可以省略 JSESSIONID 吗?

有没有办法以某种方式“加入”两者?提前致谢。

最佳答案

否,当前实现中两者都是必需的。

Hazelcast 仅使用 hazelcast.sessionId 作为 HttpSession.getId() 并且几乎在所有地方都用于识别分布式 session 。但是对于某些情况,例如故障转移,Hazelcast 在内部同时使用 session 标识符(hazelcast.sessionIdJSESSIONID )。

From Hazelcast documentation :

SessionId Generation

SessionId generation is done by Hazelcast Web Session Module if session replication is configured in the web application. Default cookie name for the sessionId is hazelcast.sessionId and this is configurable with cookie-name parameter in the web.xml file of the application. hazelcast.sessionId is just a UUID prefixed with “HZ” character and without “-“ character, e.g. HZ6F2D036789E4404893E99C05D8CA70C7.

When called by the target application, the value of HttpSession.getId() is the same as the value of hazelcast.sessionId.

关于session - JSESSIONID 和 hazelcast.sessionId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25621891/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com