Skip to content

Instantly share code, notes, and snippets.

View cliffordoravec's full-sized avatar

Clifford Oravec cliffordoravec

View GitHub Profile
@cliffordoravec
cliffordoravec / satellizer-storage-decorator.js
Last active September 17, 2018 14:22
Using Satellizer with and across subdomains using cookies
/*
Satellizer's storage service can use 'localStorage' and 'sessionStorage' by default.
None of these options work well if you need to use Satellizer with or across subdomains.
(Given, there is the fun iframe and postMessage workaround, but that's really inconvenient.)
Here's a simple approach using cookies for storage, which can be used across subdomains
(since cookies can be used across subdomains, right?).
By default, $http is configured with withCredentials set to false, so the cookies themselves