Need to clear local storage on browser tab closed not on refresh

15,499

Refreshing and closing a tab/window is the same event as far as the browsers are concerned.

Best would be to use session storage rather than local storage as session would be active until the tab/window is closed and not refreshed and you aren't saving persistent data.

Have a look here

Share:
15,499

Related videos on Youtube

Sankar
Author by

Sankar

I am a PHP developer

Updated on June 08, 2022

Comments