Replies: 2 comments
-
There is nothing inherently built-in to local storage which would allow for this. However, this should be relatively easy to achieve in your code. You could store your data as an object which includes an expired time property. Then you could check that before performing any logic on the rest of the data. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you Chris for the prompt reply. Yes, this is the easiest solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way to set a lifetime of the stored Key/value pairs in the local storage, I'm using it to store the logged in username, so to achieve the same concept of persistent cookies of Cookie Authentication, we have to add an expiry after x number of days for example.
Beta Was this translation helpful? Give feedback.
All reactions