I need to destroy session after page closed in browser. i tried to unset $_session['value']; but it can not working it destroy current page but i need destroy after closed in browser
1 Answer
You can write this
session_set_cookie_params(0);
session_start();
This will destroy session when the browser is closed.
-
Is this work on page close in browser?– user6303241Jul 6, 2016 at 11:01
-
-
May be you can find the answer here stackoverflow.com/questions/3177364/…. hopefully this might help you Jul 6, 2016 at 11:13
unload
and asynchronously call a php page which then destroys the session. But I think every professional php/js-developer will hate me for that idea...