Skip to content
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

Adding control of expiration time in localstorage. Issue #133. #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rodrigo-morais
Copy link

Hello,

I created a control to expiration time in localstorage.

For example:
localStorageService.get('key', 300000); -> Verify if expiration time happened for 5 minutes in milliseconds.

Important, when need use localstorage against sessionstorage and must control expiration time.

Thanks.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) when pulling e92355a on rodrigo-morais:master into d85bdb5 on grevory:master.

@a8m
Copy link
Collaborator

a8m commented Oct 23, 2014

Ah.. I got it.
It's not a real expiration, the value still in the localStorage...
mm.. I'm think we need the users feedback..

@rodrigo-morais
Copy link
Author

If everyone think necessary, I can clear the key in localStorage.

I didn't that because in my use case was unnecessary and I not thought about.

@eshleebien
Copy link

this is very useful! (y)

@brandonburkett
Copy link

Is this TTL support basically? if so, I rolled my own but would love to use the "built in" one.

@brantje
Copy link

brantje commented Nov 1, 2014

Would be awsome to have this.

@rodrigo-morais
Copy link
Author

Hello,

I added for expiration data the option to remove key from localStorage.
When method get is called with true in last/third parameter and expiration happen then the key will be remove from localStorage.

For example:
localStorageService.get('key', 300000, true); -> Verify if expiration time happened for 5 minutes in milliseconds and if happens the key will be remove from localStorage.

The standard of remove flag is false. If not pass anything in parameter the key won't be remove.

Thanks.

@Mouvedia
Copy link

I need this.

@raduq
Copy link

raduq commented Oct 26, 2016

I want this feature.

@grevory
Copy link
Owner

grevory commented Jun 19, 2017

Is anyone interested in fixing up this PR? This seems to be very desired among users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants