url glassfish 中的 jsessionid
我有一个在 glassfish 3.1.1 上运行的 Web 应用程序,带有 struts2 和 spring。
在我实现 struts2 ssl 插件后,我遇到了一些与 jsessionid cookie 相关的问题。问题是,如果我直接访问 https,则不会生成 cookie,我必须请求页面的 http 版本,然后 struts2ssl 插件将我重定向到 https,一切正常。第二个问题是我决定在用户登录后重新生成会话ID(为了防止会话固定)并且新的会话ID也没有写入cookie。有了这些,我决定使用附加 url 的 jsessionid,这解决了这两个问题。正如您所料,这里还有另一个问题,那就是如果我尝试通过 http://myServer:8080/ 访问该应用程序MyApp 中,jsessionId 已正确附加,但如果通过 glassfish 虚拟主机访问同一个应用程序,则不再附加 jsessionid。
我怀疑虚拟主机配置有问题......
有什么想法吗?
谢谢,
I have a web app running on glassfish 3.1.1 with struts2 an spring.
After i implemented struts2 ssl plugin i had some problems related to jsessionid cookie. The problem was that if i wag going directly to https the cookie was not generated, and i have to ask for http version of the page and then struts2ssl plugin redirects me to https and everything was ok. The second problem is that i decided that after the user had logged in to regenerate the session id (in order to prevent session fixation) and the new session id was nor written to cookie. With all these i decided to use url appended jsessionid, which solved those 2 problems. As you expected there is another problem here, and this is that if i try to access the app via http://myServer:8080/MyApp , the jsessionId is appended correctly, but if the same app is accessed via a glassfish virtualhost the jsessionid isn`t appended anymore.
I suspect a issue with the vhost configuration....
Any ideea?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加到 web.xml 应该可以解决问题
根据规范,
Adding
into web.xml should do the trick, according to specification