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

后端 未结 8 1723
-上瘾入骨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:33

    As Eric mentioned the unload event on the browser can call a javascript function, which in turn can access an url through a servlet that logs you out. You need not wait for the actual response from the servlet.

    The web browser interacts with the server through the http protocol and that is stateless.

提交回复
热议问题