Scenario:
For example: Anonymous User enters my website xyz.com, I have to show a popup "Hey welcome", If user opens a new tab without closing the browser and enters xyz.com then we should not show the popup again. If the user closes the browser and come back again to xyz.com then we have to show "Hey welcome".
Note:
No server-side involved. Need a client side solution.
What I tried:
I have tried cookie without expiry
document.cookie = "welcome=true";
But cookie is not deleted on close of browser.
No, luck with onbeforeunload and unload Since event is triggered on page refresh
Any idea or suggestion will be grateful to solve this issue.