Issue
I am building a mobile application in Angular (Ionic 5 to be precise) and I need a way to keep session data during my users workflow.
I considered using the sessionStorage for that, but one important thing is that my user session should expire automatically after 5 minutes. So I would like to store data and reset those data if the user finish the workflow or reset them if the user didn't finished the workflow within 5 minutes.
What is the best way to do this?
Solution
Store the expiry time along with the data in sessionStorage
and when reading the key, check the time to make sure it is still valid for usage.
See this article for reference.
I can't include a Stack Snippet here because it fails on security privileges (editing the localStorage etc.), so here's the link to try this on GitHub.
Answered By - Lakshya Raj
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.