In chrome browser session not removing when client close the browser. I have tried to session expiration but its not working.
Asked
Active
Viewed 250 times
1
-
$config['sess_expiration'] = 0; is not working – Chirag Kamani Oct 02 '19 at 08:48
-
in config.php file `$config['sess_expire_on_close'] = TRUE;` Whether to cause the session to expire automatically when the browser window is closed. – KUMAR Oct 02 '19 at 09:20
-
in { config.php file $config['sess_expire_on_close'] = TRUE; } is not working in chrome browser – Chirag Kamani Oct 02 '19 at 09:35
-
related: https://stackoverflow.com/a/20806014/2275490 – Vickel Oct 02 '19 at 10:28
1 Answers
0
Try this jquery window close event
window.onbeforeunload = function () {
$.ajax({
url: '<?php echo serverUrl; ?>/handle_session.php',
type: 'POST',
datatype: 'json',
success: function(data) {
alert("Successful");
}
});
return "Do you really want to close?";
};
Hope this will help you.

NomanJaved
- 1,324
- 17
- 32