I am trying to bypass chromes "Continue from where you left off" session cookie issue, where cookies are not destroyed after closing browser window / tab.
To do this I have added an beforeunload
listener to the window, that fires a function to remove a cookie:
window.addEventListener('beforeunload', destroySession)
However this also destroys a cookie when I refresh the page or click on "go back" buttons in the browser, so I need sub sequential checks in my destroySession
function to see what caused beforeunload
to happen.