Java:Why http session is not destroyed when tab or browser is closed?

后端 未结 8 1701
-上瘾入骨i
-上瘾入骨i 2020-12-06 00:54

I have the following implementation of HttpSessionlistener

public class SessionListener implements HttpSessionAttributeListener, HttpSessionListener {


publ         


        
8条回答
  •  自闭症患者
    2020-12-06 01:14

    you can just verify if your session user , aren't null like :

    if (session.getAttribute("user") != null )
       sessionsetAttribute("user","null");
    

提交回复
热议问题