weblogic jsessionid [英] weblogic jsessionid

查看:43
本文介绍了weblogic jsessionid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地运行 Weblogic 10.3 并且对它生成的 sessionId 有疑问.当我打印 session.getId() 时,我看到类似这样的内容:

I run Weblogic 10.3 locally and have a question about the sessionId that it generates. When i print session.getId() i see something that resembles this:

BBp9TAACMTglQ2TDFAKR4tpyXg73LZDQJ2PtT9x8htG1tWY122aa!869187422!1308677666322

BBp9TAACMTglQ2TDFAKR4tpyXg73LZDQJ2PtT9x8htG1tWY122aa!869187422!1308677666322

这些感叹号是什么以及它后面是什么,特别是第二对: !1308677666322 ?看起来有时服务器会附加它,有时不会.如果我第二次使用相同的浏览器登录我的应用程序,我相信 weblogic 会附加它.这个 cookie 有什么关系吗?

what are these exclamation points and what follows it, specifically the second pair: !1308677666322 ? It looks like sometimes the server appends it and sometimes it doesn't. I believe weblogic appends it if I use the same browser to login to my app for the second time. Is this cookie related somehow?

推荐答案

从我自己的应用程序中查看一些随机生成的 Weblogic JSessionID

Looking at some randomly generated Weblogic JSessionIDs from my own application

BrYx4hyPZ4VSP9Wo4eU0OrqmhXMLFONbRHnpLFwRKZ9MSaf6wvYj!-314662473

BrYiFED29itaC4EBpWYM8RKVQQauHkvnTsA2OAKUPZXVc9oUD5fB!-784323496.

现在,如果您注意到会话 ID 在第一个 ! 之后的部分,即 314662473784323496.

Now if you notice the part of the session id after the first ! i.e 314662473 and 784323496.

这个数字是 Weblogic 为正在运行的 JVM(即正在运行的 Weblogic 服务器)提供的唯一标识符.

This number is the unique identifier that Weblogic gives to the running JVM i.e. the running Weblogic server.

如果您的应用程序中有多个服务器,Weblogic 知道如何使用作为会话 ID 一部分的 9 位 JVM 编号将您的会话路由回正确的服务器.

If there is more than one server in your application, Weblogic knows how to route your session back to the correct server by using this 9 digit JVM number which is part of the session ID.

每次重新启动 weblogic 服务器时,它都会生成一个新的 JVM id 并在该 weblogic 服务器运行时使用它.因此,任何对该服务器的点击都将在会话 ID 的末尾具有相同的 ID.

Each time you restart the weblogic server, it will generate a new JVM id and use it as long as that weblogic server is running. So any hits to that server will have the same ID at the end of the session ID.

会话 ID 的格式是:

JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!SECONDARY_JVM_HASH!CREATION_TIME

JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!SECONDARY_JVM_HASH!CREATION_TIME

因此,如果主服务器不可用,它将尝试跳转到辅助服务器,如果您启用了会话复制 - 那么会话数据就可以恢复.如果您只在本地运行一个服务器,那么格式很简单

So if the primary is not available, it will try to jump over to secondary and if you have enabled session replication - then the session data can be recovered. If you are running only a single server on local, then the format is simply

JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!CREATION_TIME

JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!CREATION_TIME

关于有时它没有出现,我看到它通常取决于浏览器是否显示在地址栏中

regarding some times it does not appear, I've seen it is usually a browser dependent whether the sessionid is shown in the address bar or not

这篇关于weblogic jsessionid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆