简体   繁体   English

JSP中的登录页面会话超时问题

[英]Login page session timeout issue in JSP

How can we make login page sessionless ? 如何使登录页面变为无会话状态? I have tried using <%@page session="false" %> but it doesn't work if I open a login page and try using page after timeout (specified in web.xml) it won't login because my handshake encryption key stored in session is not available now and session is already invalidated. 我曾尝试使用<%@page session="false" %>但是如果我打开登录页面并尝试在超时后使用页面(在web.xml中指定),它将无法登录,因为我的握手加密密钥无法使用会话中存储的内容现在不可用,并且会话已失效。

How can we tell server not to create session for login page ? 我们如何告诉服务器不要为登录页面创建会话? I am also using Spring security in my application if that can help. 如果可以,我也在我的应用程序中使用Spring安全性。

Make change in web.xml and set session-timeout to -1 . 在web.xml中进行更改,并将session-timeout设置为-1

<session-config>
      <session-timeout>-1</session-timeout>
</session-config>

Now it will never expire. 现在它将永远不会过期。

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

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