how to delete token in local storage only on browser close not on refresh I am using below approach but it is getting removed on refresh also please provide a better solution as I tried many ways it is getting failed all times
is there any alternate way please provide a solution thanks in advance
window.onunload = function () {
localStorage.removeItem('token');
}