HttpSessionListener not detecting session timeout

南楼画角 提交于 2019-11-29 15:25:27

The sessionDestroyed() method is not called until the web container expires the session. The server doesn't know you deleted the JSESSIONID cookie, your browser just looks like another new session.

From what I've seen with Tomcat, and I believe it's up to each web container implementation, session expirations happens every minute. So even after the session times out there could be a delay until the next detection of expirations.

It should definitely happen eventually though. Especially if you set the timeout to a minute and wait a few minutes. Note the timeout is specified in minutes, so one minute is the minimum to test with. I assume you have your listener registered in your web.xml file?

you need to register listener in web.xml under WEB-INF in your application. your listener class name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!