ember-preferences icon indicating copy to clipboard operation
ember-preferences copied to clipboard

Cookie backend

Open san650 opened this issue 9 years ago • 0 comments

Add the ability to configure a cookie based backend to store the preferences.

The idea is to give the user the option to use only cookie-based store, or to use the cookie-based store as a fallback for the local storage backend.

The configuration of the backend will be done via the preferences.js configuration file (see #1).

export default {
  backends: ['local', 'cookie']
};

Where the backends value will be used as follows:

  • If it's not defined, use localStorage backend and cookie backend as fallback
  • If it's defined as an empty array, use memory backend (plain object see #3)
  • If it's ['cookie'] use cookie backend with memory as fallback
  • If it's ['local'] use localStorage backend with memory as fallback

Note that memory backend is always the last fallback.

san650 avatar Mar 13 '16 23:03 san650