在 tomcat 中调用 session.invalidate() 时会发生什么
当用户注销时,我们正在执行 session.invalidate()。
但是,如果会话由 tomcat 持久保存(默认情况下会这样做),并且如果同一用户尝试在短时间内访问 web 应用程序,则是否有可能恢复并重用相同的持久会话?
tomcat在重新加载或重新启动应用程序期间会使会话无效吗?...server.xml中的“saveOnRestart”配置是否完全控制了这一点?
when a user logsout we are doing a session.invalidate().
But is it possible that if sesions are persisted by tomcat, which it does by default, and if the same user tries to access the webapp in a shortwhile, the same persisted session is restored and reused??
does tomcat invalidate session during reload or restart of application?... does the "saveOnRestart" configuration in server.xml completely control this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果同一用户尝试访问该应用程序,则会为他生成一个新的会话 ID,因此他无法访问上一个会话中的任何内容(即使尚未删除,但很可能会被删除)。实现细节在这里并不重要 - 重点是当会话过期或失效时,所有会话数据都会丢失。
If the same user tries to access the app a new session id is generated for him and so he can't access anything from the previous session (even if it hasn't been deleted yet, but it is likely to be deleted). The implementation details don't matter here - the point is that when the session expires or is invalidated, all the session-data is lost.