All Projects β†’ simplabs β†’ Ember Cookies

simplabs / Ember Cookies

Licence: mit
Cookies abstraction for Ember.js that works both in the browser as well as with Fastboot on the server

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ember Cookies

Mern Login Signup Component
Minimalistic Sessions based Authentication app πŸ”’ using Reactjs, Nodejs, Express, MongoDB and Bootstrap. Uses Cookies πŸͺ
Stars: ✭ 74 (-32.11%)
Mutual labels:  cookies
Ember Cli Stripe
Stripe checkout for Ember
Stars: ✭ 84 (-22.94%)
Mutual labels:  ember
Emberconf 2017
A collection of links that summarize EmberConf 2017
Stars: ✭ 103 (-5.5%)
Mutual labels:  ember
Ember Cli Bundle Analyzer
Analyze the size and contents of your Ember app's bundles
Stars: ✭ 78 (-28.44%)
Mutual labels:  ember
Ember Drag Sort
A sortable list component with support for multiple and nested lists
Stars: ✭ 82 (-24.77%)
Mutual labels:  ember
Broccoli Serviceworker
ServiceWorker generator for Broccoli and Ember.js
Stars: ✭ 93 (-14.68%)
Mutual labels:  ember
Ember Cli Clipboard
A simple ember wrapper around clipboard.js
Stars: ✭ 72 (-33.94%)
Mutual labels:  ember
Ghost
Turn your audience into a business. Publishing, memberships, subscriptions and newsletters.
Stars: ✭ 39,261 (+35919.27%)
Mutual labels:  ember
Ember Steps
Declaratively create wizards, tabbed UIs, and more
Stars: ✭ 84 (-22.94%)
Mutual labels:  ember
Ember Osf Web
Ember front-end for the Open Science Framework
Stars: ✭ 102 (-6.42%)
Mutual labels:  ember
Ember Cli Sentry
Error tracking via Sentry for Ember.js apps
Stars: ✭ 81 (-25.69%)
Mutual labels:  ember
Authenticationintro
Stars: ✭ 82 (-24.77%)
Mutual labels:  cookies
Ember Wordpress
The bridge between Ember.js and Wordpress
Stars: ✭ 94 (-13.76%)
Mutual labels:  ember
Fakturama
Wystawiaj faktury za darmo i bez ograniczeΕ„
Stars: ✭ 76 (-30.28%)
Mutual labels:  ember
Ihavecookies
jQuery plugin to display cookie consent message (EU regulation)
Stars: ✭ 106 (-2.75%)
Mutual labels:  cookies
Ember Cli Coffeescript
Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
Stars: ✭ 72 (-33.94%)
Mutual labels:  ember
Com.zsmartsystems.zigbee
ZigBee Cluster Library Java framework supporting multiple dongles
Stars: ✭ 93 (-14.68%)
Mutual labels:  ember
Requests
A simple, yet elegant, HTTP library.
Stars: ✭ 46,558 (+42613.76%)
Mutual labels:  cookies
Sessionup
Straightforward HTTP session management
Stars: ✭ 107 (-1.83%)
Mutual labels:  cookies
Ember Cli Postcss
πŸ”₯ A Postcss integration for ember-cli
Stars: ✭ 97 (-11.01%)
Mutual labels:  ember

CI

ember-cookies

ember-cookies implements an abstract cookie API that works both in the browser (via document.cookie) as well as with Fastboot in the server context (using the request and response accessible via the fastBoot service).

Having access to cookies both in the browser as well as in FastBoot is key to being able to share a common session.

Installation

Install ember-cookies with

ember install ember-cookies

Example Usage

// app/controllers/application.js
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
const { keys } = Object;

export default class ApplicationController extends Controller {
  @service cookies;

  @computed
  get allCookies () {
    let cookieService = this.cookies;
    cookieService.write('now', new Date().getTime());

    let cookies = cookieService.read();
    return keys(cookies).reduce((acc, key) => {
      let value = cookies[key];
      acc.push({ name: key, value });

      return acc;
    }, []);
  }
}

API

The cookies service has methods for reading and writing cookies:

  • read(name, options = {}): reads the cookie with the given name, returns its value as a String; options can be used to set raw (boolean, disables URL-decoding the value).
  • write(name, value, options = {}): writes a cookie with the given name and value; options can be used to set domain, expires (Date), maxAge (time in seconds), path, secure, raw (boolean, disables URL-encoding the value) and sameSite.
  • clear(name, options = {}): clears the cookie so that future reads do not return a value; options can be used to specify domain, path or secure.
  • exists(name): checks whether a cookie exists at all (even with a falsy value) and returns true if that is the case or false otherwise.

License

ember-cookies is developed by and Β© simplabs GmbH and contributors. It is released under the MIT License.

ember-cookies is not an official part of Ember.js and is not maintained by the Ember.js Core Team.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].