there are lot questions similar to this question and many answers too. But all the answers are saying similar thing. Hence please help me with this. Problem : When user closes tab or browser then i want to destroy session. solutions tried : I have tried following in jquery. - onbeforeunload() : destroy session using ajax. But it works even on refresh of page. - setting flag=1 on load() and flag=0 on unload() updating in db. But session wont be destroyed. - set session time out. But before session time out if they open then it will be logged in. Hence i want some solution that over rides all these restrictions and works like bank apps or some security apps.
Thanks in advance.