PHP - Session destroy after closing browser

前端 未结 9 1464
陌清茗
陌清茗 2020-11-27 07:43

Though this question has multiple duplicates i could not find proper solution for me. Need Some help.

I have used ini_set(\'session.cookie_lifetime\', 0);

9条回答
  •  不知归路
    2020-11-27 08:14

    You can do it using JavaScript by triggering an ajax request to server to destroy the session on onbeforeunload event fired when we closes the browse tab or window or browser.

提交回复
热议问题