I stored a variable in sessionStorage. When I reload the webpage, sessionStorage don't set this variable to null. I must close the window and open a new one to do this. So, How can I know user reload page by javascript, I need sessionStorage set to null when I reload page
localStorage. Set some value to it initially.. if the user reloads the page you can check this value and open a new tab.onbeforeunload?