Welcome Guest, Not a member yet? Register   Sign In
Destroy sessions if the user closes the browser
#1

[eluser]Eng.Faruk[/eluser]
I want to destroy all the sessions if the user closes the browser window or a single tab or navigates away from the page. Is there any way I can do this?
#2

[eluser]WanWizard[/eluser]
Not reliably.

You can set up some javascript that is triggered when the window or tab is closed, and would request "http://yourapp/logout", but it will not work in all cases, and it's easily blocked.

It is better to have sessions expire at browser close, and after a relative short time of inactivity.
#3

[eluser]Eng.Faruk[/eluser]
Thanks for your advice




Theme © iAndrew 2016 - Forum software by © MyBB