简体   繁体   English

如何在Java Web应用程序中禁用Cookie时维护会话

[英]How to maintain session at when cookies are disabled in java web application

How to maintain sessionwhen cookies are disabled .When i cleared my history in firefox the session is expiring.But i dont want to expire the session at client side.What is the way way to maintain session when cookies are disabled.I am using struts2 .I saw some sites which are doing it. 禁用cookie时如何维护会话。当我在firefox中清除历史记录时,会话即将到期。但是我不想在客户端终止会话。禁用cookie时维护会话的方式是什么。我正在使用struts2。我看到一些网站正在这样做。

Thanks in advance.. 提前致谢..

I guess, your session is preserved via cookies. 我想,您的会话是通过Cookie保留的。 If you delete clear your history, the jsession-cookie is deleted as well. 如果删除清除历史记录,则jsession-cookie也将被删除。

What you are looking for is Sessionpreservation via URLRewrite. 您正在寻找的是通过URLRewrite进行的Sessionpreservation。 Then the sessionid is attached to every link like 然后将sessionid附加到每个链接,例如

http://localhost:8080/index.html;jsessionid=234fds

You have to consult the manual of your Servletcontainer/Applicationserver how to enable it. 您必须参考Servletcontainer / Applicationserver的手册来启用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM