In my website, I am using session storage to store some data. Now in a use case, a user gets redirected to another website to complete the transaction and is again redirected back to my website. Sometimes I do not see the session storage variable I saved before the user was redirected to another website. I am seeing this issue across all browsers - Chrome, Safari, Mozilla. Can anyone suggest if this is a known issue with session storage or I am missing something here?
Asked
Active
Viewed 1,454 times
0
-
Share your snippets – PriyankMotivaras Jul 13 '22 at 08:01
1 Answers
-1
That's the point of sessionStorage
: docs
You probably wanna use localStorage
and clean it manually when not needed anymore

Nicola Spadari
- 549
- 3
- 10
-
The docs does not mention anything about session ending if user stays in same tab – Ipsit Gaur Jul 13 '22 at 07:40
-
No, but you said "a user gets redirected to another website to complete the transaction and is again redirected back to my website", so when you leave the tab the session storage gets cleared – Nicola Spadari Jul 13 '22 at 07:44
-
User does not leave the tab, he is redirected in the same tab and comes back in the same tab only – Ipsit Gaur Jul 13 '22 at 07:59