simplabs / Ember Cookies
Licence: mit
Cookies abstraction for Ember.js that works both in the browser as well as with Fastboot on the server
Stars: β 109
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
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
Ember Wordpress
The bridge between Ember.js and Wordpress
Stars: β 94 (-13.76%)
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
Ember Cli Postcss
π₯ A Postcss integration for ember-cli
Stars: β 97 (-11.01%)
Mutual labels: ember
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 aString
; options can be used to setraw
(boolean, disables URL-decoding the value). -
write(name, value, options = {})
: writes a cookie with the given name and value; options can be used to setdomain
,expires
(Date),maxAge
(time in seconds),path
,secure
,raw
(boolean, disables URL-encoding the value) andsameSite
. -
clear(name, options = {})
: clears the cookie so that future reads do not return a value; options can be used to specifydomain
,path
orsecure
. -
exists(name)
: checks whether a cookie exists at all (even with a falsy value) and returnstrue
if that is the case orfalse
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].