This is a Web Storage manager supporting expiration time.
- type(String): "localStorage"(default) or "sessionStorage"
(Boolean): Returns Web Storage is supported.
When passed a key/value pair, set that pair.
- key(String): The name of the key you want to create or update.
- value(String): The value of the key/value pair.
- options(Object): The options object.
Name | Values | Description |
---|---|---|
type | "localStorage"(default), "sessionStorage" | Web Storage type |
from | UTC timestamp in milliseconds | start time of valid period |
to | UTC timestamp in milliseconds | end time of valid period |
No return value. If Web Storage is not supported or expired, null is returned.
When passed a key, will return that key's value.
- key(String): The name of the key you want to retrieve.
- options(Object): The options object.
Name | Values | Description |
---|---|---|
type | "localStorage"(default), "sessionStorage" | Web Storage type |
The value of the key/value pair. If Web Storage is not supported or expired, null is returned.
When passed a key, will delete a key/value pair.
- key(String): The name of the key you want to retrieve.
- options(Object): The options object.
Name | Values | Description |
---|---|---|
type | "localStorage"(default), "sessionStorage" | Web Storage type |
No return value. If Web Storage is not supported or expired, null is returned.
MIT