How to clear the httpsession, if the user close the browser in java

前端 未结 5 1724
闹比i
闹比i 2021-01-03 01:51

I am trying to clear the HttpSession if the consumer close the browser window. I dont know how to do it, Please help me anyone

Thanks & Regards Chakri

5条回答
  •  春和景丽
    2021-01-03 02:35

    if you close the browser it is already clear the session

    but if you want to force to clear the session

    usesession.invalidate(); or if you want to remove specific session use session.removeAttribute("");

提交回复
热议问题