# 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
Methods
# static clear() → {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.
Promise
# static persist(data) → {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.
Promise
# static restore() → {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.
Promise