New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/expire #5
Conversation
@hakod thank you for the quick PR.
|
@dr-dimitru No problem! Yeah, I was concerned that the setTimeout would be interrupted. Would a timestamp be the best route and should there be a setInterval to check for expiration every so often? Thanks for reviewing. |
@hakod I believe we should utilize cookie's expiration in case if cookies are used, use records with |
@dr-dimitru Yes, I think I understand it. |
@dr-dimitru Added the cookie expiration using max-age and the prefix to store expiration times. Let me know if there are any changes needed. Thanks. |
@hakod thank you, added notes |
@dr-dimitru Thanks for the feedback, I really appreciate it. The last note was a bit difficult for me to fix. Should setInterval be triggered whenever page loads? How could I get that working? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check inside constructor if localStorage
is supported and setInterval
Hi @dr-dimitru, |
OK I think I understand it now. Would it delete without a page refresh too? |
No, only upon request if expired or on page init. Very similar to how cookies and expiration works in most of browsers |
That makes a lot more sense. Thanks. |
Hi @dr-dimitru,
I added an expiration feature for while code is still active. Wasn't sure whether to add timestamp for expiration date since the other PR already had that. Please let me know if I should change it to use a timestamp as well. Thanks again.