# new LocalStorageStore()
Session store that persists data in the browser's localStorage
.
localStorage
is not available in Safari when running in private mode. In
general it is better to use the
AdaptiveStore that automatically falls back to
the CookieStore when localStorage
is not
available.
This session store does not work with FastBoot. In order to use Ember Simple Auth with FastBoot, configure the CookieStore as the application's session store.
Extends
Members
String
# static key
The localStorage
key the store persists data in.
Properties:
Name | Type | Description |
---|---|---|
key |
- Default Value:
- 'ember_simple_auth-session'
Methods
# static clear() → {Ember.RSVP.Promise}
Clears the store by deleting the
LocalStorageStore.key from
localStorage
.
A promise that resolves when the store has been cleared successfully and rejects otherwise.
Ember.RSVP.Promise
# static persist(data) → {Ember.RSVP.Promise}
Persists the data
in the localStorage
.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object
|
The data to persist |
A promise that resolves when the data has successfully been persisted and rejects otherwise.
Ember.RSVP.Promise
# static restore() → {Ember.RSVP.Promise}
Returns all data currently stored in the localStorage
as a plain object.
A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.
Ember.RSVP.Promise