Coder Social home page Coder Social logo

mainmatter / ember-cookies Goto Github PK

View Code? Open in Web Editor NEW
115.0 115.0 45.0 3.38 MB

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

License: MIT License

JavaScript 96.46% HTML 3.28% Handlebars 0.26%
cookies ember fastboot

ember-cookies's People

Contributors

bdelaforest avatar bobrimperator avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dillonwelch avatar ember-tomster avatar esbanarango avatar exelord avatar geekygrappler avatar greenkeeper[bot] avatar jayjayjpg avatar jdaviderb avatar jeremywrowe avatar josemarluedke avatar joshuabremer avatar loganrosen avatar marcoow avatar mike-north avatar omairvaiyani avatar oscard0m avatar pangratz avatar renovate[bot] avatar sergeastapov avatar turbo87 avatar vincent99 avatar xaseracheron avatar zeppelin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cookies's Issues

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Cannot read fastboot request's cookies if simple-auth writes a fastboot cookie first

The issue:

In our application, we first use simple-auth to authenticate and store some session info. Soon after, we read some cookies. When we are in fastboot, the first time we try to read a cookie, it is coming as undefined. After some digging, I think I can see the problem - the _cacheFastBootCookie method is using the same object to write new fastboot cookies that _fastBootCookies computed is using to read back fastboot cookies. That property is _fastBootCookiesCache.

When _fastBootCookies first computes, it checks for the existence of _fastBootCookiesCache. If it doesn't exist, it will read _fastBoot.request.cookies and cache those in _fastBootCookiesCache. If simple-auth happened to have written a cookie before this computed runs, _fastBootCookiesCache will already exist, and it will never read the _fastBoot.request.cookies. Instead it will just read back the cookie that simple auth wrote.

So what I think is needed is for the _fastBootCookies computed to be called before writing a fastboot cookie if that underlying _fastBootCookiesCache doesn't exist. Thoughts?

Update: for anyone else facing this issue, a work-around you can do in your own code is to call a cookie read before doing any simple-auth work, which will cache those fastboot.request cookies before simple-auth can "lock them out" after writing its cookie.

clearAll() method

It looks like we can already read() all available cookies and clear() a single cookie. For testing purposes it might make sense to have a clearAll() method as well, to be able to start an acceptance test without any cookies.

An in-range update of ember-source is breaking the build 🚨

Version 2.12.0 of ember-source just got published.

Branch Build failing 🚨
Dependency ember-source
Current Version 2.11.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-source is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 280 commits (ahead by 280, behind by 90).

  • 1841cd8 Release v2.12.0
  • d91b748 More CHANGELOG typos [ci skip]
  • 6568560 fix changelog typo [ci skip]
  • b0d527b Typo [ci skip]
  • 47cf31d Prepare CHANGELOG for 2.12.0 [ci skip]
  • 2a1b600 Update factoryManagerCache initial value to not share factoryCache.
  • 8fb1fb9 Adding test around factoryManager caching
  • b542bc5 allocate iteration structures lazily (pt. 2)
  • 09c1218 [Fixes #15001] Remove internal EmptyObject usage
  • daefda7 [BUGFIX beta] [PERF] Cache FactoryManagers
  • 25cf68a [BUGFIX beta] only defProp the deprecated container once per prototype
  • 756c845 allocate iteration structures lazily
  • bdb46eb [DOCS beta] factoryFor docs
  • 51d039e Avoid a couple of redundant property loads.
  • c104dcd Fix typo

There are 250 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

ember-getowner-polyfill is deprecated

DEPRECATION: ember-getowner-polyfill is now a true polyfill. Use Ember.getOwner directly instead of importing from ember-getowner-polyfill

the package is still in the dependencies

An in-range update of ember-data is breaking the build 🚨

Version 2.12.0 of ember-data just got published.

Branch Build failing 🚨
Dependency ember-data
Current Version 2.11.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-data is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes Ember Data 2.12.0

Release 2.12.0 (March 13, 2017)

  • #4805 Don’t redefine findPossibleInverses for each _findInverseFor
  • #4808 Avoid mutating model factory in _modelForMixin.
  • #4810 [Fixes #4807] realize class + factory seperation
  • #4743 [BUGFIX canary] Fix _lookupFactory deprecation for Ember canary
  • #4765 [DOC] Make model.unloadRecord public (#4765)
  • #4792 [BUGFIX beta] revert deletion of filter that removed deleted model…
  • #4789 Do not access container if Ember.getOwner exists.
  • #4760 Update deprecate arguments (#4760)
  • #4698 [FIX backburner] Avoids spinning up unnecessary run loops via run.join
  • #4638 Update the API docs for snapshots
  • #4705 Underscores the already private store.reloadRecord method
  • #4663 Silence warnings and deprecations in the console during tests
  • #4642 Add API docs for the HasManyReference
  • #4706 Improved performance for findHasMany finder
  • #4684 Modernizes relationship containers
  • #4664 Upgraded IdentityMap and RecordMap
  • #4668 [PERF] use micro-queue
  • #4699 include related record on the complex test
  • #4688 Fixed a typo
  • #4685 [FEATURE ds-rollback-attribute] rename ds-reset-attribute
  • #4686 [FEATURE ds-improved-ajax] Disable feature
  • #4704 Factory cache
  • #4696 fix(benchmarks): benchmarks for store.query no longer included record…
  • #4691 [BUGFIX beta] Add blueprints for "ember-cli-mocha >= 0.12.0"
  • #4697 chore(benchmarks): benchmarks needed to time a few lookups for us to …
  • #4701 [PERF] flatten DS.Model to avoid multi-extend, expensive reopens, and extra mixin detection
  • #4702 Enable the ds-check-should-serialize-relationships feature flag
  • #4703 Removes store._adapterRun
  • #4716 [DOC canary] Updating CONTRIBUTING.md to use ember-twiddle as examples
  • #4718 [BUGFIX beta] Inverse null relationships should throw if model doesn't exist 3
  • #4734 [DOC] fix a couple of typos in model class docs
  • #4739 Removed id in urlForFindAll signature
Commits

The new version differs by 92 commits (ahead by 92, behind by 22).

  • fd06e1f Pull in loader.js from the dist directory instead of the lib directory (#4824)
  • 0f73468 Release Ember Data 2.12.0
  • 6395eb7 Update the changelog for the Ember Data 2.12.0 release
  • 04cbbb5 Release Ember Data 2.12.0-beta.4
  • 8511886 Update changelog for the 2.12.0-beta.4 release
  • 3637db8 [Fixes #4807] realize class + factory seperation
  • d7fbbad Don’t redefine findPossibleInverses for each _findInverseFor
  • ce95bb2 Avoid mutating model factory in _modelForMixin.
  • 14a75bc Release Ember Data 2.12.0-beta.3
  • b96685f Update changelog for Ember Data 2.12.0-beta.3
  • 83ca6e2 Merge pull request #4792 from runspired/2.12-beta-hotfix
  • d94a299 don't remove unpersisted deletes
  • 52028db Add a test for #4770
  • 4a71fea [BUGFIX beta] revert deletion of filter that removed deleted models when flushCanonical of hasMany was called
  • 315b31c Do not access container if Ember.getOwner exists.

There are 92 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

DEPRECATION: Use of `merge` has been deprecated

DEPRECATION: Use of `merge` has been deprecated. Please use `assign` instead. [deprecation id: ember-polyfills.deprecate-merge] See https://emberjs.com/deprecations/v3.x/#toc_ember-polyfills-deprecate-merge for more details.

"ember-source": "~3.7.0",
"ember-cookies": "0.3.1"

An in-range update of mocha is breaking the build 🚨

Version 3.3.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build could not complete due to an error [Details](https://travis-ci.org/simplabs/ember-cookies/builds/225165221)

Release Notes coverave

Thanks to all our contributors, maintainers, sponsors, and users! ❤️

As highlights:

  • We've got coverage now!
  • Testing is looking less flaky \o/.
  • No more nitpicking about "mocha.js" build on PRs.

🎉 Enhancements

  • #2659: Adds support for loading reporter from an absolute or relative path (@sul4bh)
  • #2769: Support --inspect-brk on command-line (@igwejk)

🐛 Fixes

  • #2662: Replace unicode chars w/ hex codes in HTML reporter (@rotemdan)

🔍 Coverage

🔩 Other

Commits

The new version differs by 89 commits0.

  • fb1687e :ship: Release v3.3.0
  • 1943e02 Add Changelog for v3.3.0
  • 861e968 Refactor literal play-icon hex code to a var
  • 1d3c5bc Fix typo in karma.conf.js
  • 9bd9389 Fix spec paths in test HTML files
  • 0a93024 Adds tests for loading reporters w/ relative/absolute paths (#2773)
  • 73929ad Comment special treatment of '+' in URL query parsing
  • e2c9514 Merge pull request #2769 from igwejk/support_inspect_break_in_opts
  • 038c636 Support --inspect-brk on command-line
  • b4ebabd Merge pull request #2727 from lamby/reproducible-build
  • 882347b Please make the build reproducible.
  • a2fc76c Merge pull request #2703 from seppevs/cover_utils_some_fn_with_tests
  • ed61cd0 cover .some() function in utils.js with tests
  • f42cbf4 Merge pull request #2701 from craigtaub/landingSpec
  • 6065242 use stubbed symbol

There are 89 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Expire On Cookie

I'm curious how to set this up, I'm having trouble and have read the docs. Could you give a quick snippet on say, a 48 hour expire time?

An in-range update of ember-cli-dependency-checker is breaking the build 🚨

Version 1.4.0 of ember-cli-dependency-checker just got published.

Branch Build failing 🚨
Dependency ember-cli-dependency-checker
Current Version 1.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-dependency-checker is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 12 commits .

  • c3c7b73 1.4.0
  • db5f429 Merge pull request #69 from orf/patch-2
  • 55e9304 Update is-git-url semvar
  • 401c83f Merge pull request #68 from samdemaeyer/switch-packagemanagername-when-yarn-detected
  • 47a231a Refactor tests
  • 7a6ca3b switch the package managers name printed out when yarn.lock file is present
  • ccd0125 Merge pull request #66 from samtsai/fix-test-descriptions
  • 193060c Fix grammatical issue with test description
  • d48cb54 Merge pull request #63 from cibernox/update_dependencies
  • a01e762 Update to ember 2.10 family
  • b50bff3 Merge pull request #61 from acburdine/patch-1
  • b9d476c update .npmignore for existing files

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Null reference for some cookies

For some cookies there is null pointer exception in line.
And for this exception my sessionAuthenticated hook in ESA failed.
The cookie cause : " swagger-editor-development-mode:true" with no name

Cannot read property 'indexOf' of undefined on Fastboot

Hey there!

I was just trying this with the latest ember FastBoot (beta.4) and I get the following error:

TypeError: Cannot read property 'indexOf' of undefined at /Users/josemarluedke/Projects/myapp/dist/fastboot/vendor.js:75400:31 at /Users/josemarluedke/Projects/myapp/dist/fastboot/vendor.js:107107:80 at ....

The error points to this line: https://github.com/simplabs/ember-cookies/blob/e4b7cec51da57bd00986f658170e99b6d02d7239/addon/services/cookies.js#L129

Note, version used of ember-cookies was 0.0.7.

Update ember-getowner-polyfill for babel 6.6.x support

The one dependency that you are using ember-getowner-polyfill has a newer version where it supports a new version of babel. This is needed as I am see deprecation warning in my ember app

DEPRECATION: ember-cli-babel 5.x has been deprecated. Please upgrade to at least 
ember-cli-babel 6.6. Version 5.2.8 located: cf2-cli -> ember-cookies -> 
ember-getowner-polyfill -> ember-cli-babel

I would make a PR but not sure that is really needed

Add tests

This needs tests.

  • unit tests
  • acceptance tests

Tests need to run both in the browser as well as in Fastboot.

An in-range update of ember-cli-mocha is breaking the build 🚨

Version 0.13.3 of ember-cli-mocha just got published.

Branch Build failing 🚨
Dependency ember-cli-mocha
Current Version 0.13.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build could not complete due to an error [Details](https://travis-ci.org/simplabs/ember-cookies/builds/224544052)

Release Notes v0.13.3

Fixed bugs:

Closed issues:

  • updating project to [email protected] seems to fail on untranspiled ember-mocha in vendor.js #189
  • An in-range update of broccoli-merge-trees is breaking the build 🚨 #174
  • An in-range update of loader.js is breaking the build 🚨 #173
  • An in-range update of broccoli-concat is breaking the build 🚨 #172

Merged pull requests:

Commits

The new version differs by 26 commits0.

  • 8e78be5 0.13.3
  • 6feadca Update CHANGELOG
  • acc4f81 README: Add "Compatibility" section
  • 2a2bc51 Merge pull request #190 from ember-cli/rwjblue-patch-1
  • 9f9106e Prevent clobbering custom this.options.babel
  • 8fd835e Merge pull request #186 from ember-cli/greenkeeper/ember-load-initializers-1.0.0
  • a79af62 Merge pull request #187 from ember-cli/greenkeeper/ember-cli-test-loader-2.0.0
  • 8a37a8d fix(package): update ember-cli-test-loader to version 2.0.0
  • 377605c chore(package): update ember-load-initializers to version 1.0.0
  • 9a3bcdb Merge pull request #180 from ember-cli/greenkeeper/ember-source-2.12.0
  • 977517c chore(package): update ember-source to version 2.12.0
  • 62311aa Merge pull request #179 from ember-cli/greenkeeper/ember-resolver-3.0.0
  • 2b21d76 chore(package): update ember-resolver to version 3.0.0
  • 9d34c76 Merge pull request #178 from ember-cli/greenkeeper/broccoli-merge-trees-2.0.0
  • 46d1ee9 fix(package): update broccoli-merge-trees to version 2.0.0

There are 26 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-cli-fastboot is breaking the build 🚨

Version 1.0.0-beta.17 of ember-cli-fastboot just got published.

Branch Build failing 🚨
Dependency ember-cli-fastboot
Current Version 1.0.0-beta.16
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-fastboot is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 9 commits .

  • cb87f92 v1.0.0-beta.17
  • 365c2ba Merge pull request #371 from kratiahuja/disable-fastboot-serve
  • 878965c Merge pull request #373 from ryanone/master
  • c7dfc9e Updated information around node-inspector
  • d01c3f6 Enable a way to disable fastboot serving at runtime and via environment variable.
  • 38892b1 Merge pull request #356 from kratiahuja/serve-refactor
  • ecdb661 Fastboot serve refactor (unifying the experience with ember-cli)
  • 444f7d2 Merge pull request #364 from kellyselden/redirect-to-self
  • e44c95f add test coverage for noop redirects

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Can't be used without FastBoot

It's currently not possible to use this addon without also including the FastBoot addon. Any attempt to inject the service results in Attempting to inject an unknown injection: service:fastboot errors.

An in-range update of loader.js is breaking the build 🚨

Version 4.2.3 of loader.js just got published.

Branch Build failing 🚨
Dependency loader.js
Current Version 4.2.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As loader.js is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 3 commits .

  • 1075ea4 4.2.3
  • 9c34843 Merge pull request #113 from ember-cli/check-extensibility
  • a1950aa Check object extensibility before adding default property.

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-cli-babel is breaking the build 🚨

The dependency ember-cli-babel was updated from 7.4.2 to 7.4.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ember-cli-babel is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v7.4.3

🐛 Bug Fix

🏠 Internal

Committers: 2

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

ember-getowner-polyfill is deprecated

DEPRECATION: ember-getowner-polyfill is now a true polyfill. Use Ember.getOwner directly instead of importing from ember-getowner-polyfill [deprecation id: ember-getowner-polyfill.import]

clear method doesnt work

i try to clear user cookie in my ember app. and the cookie still there...

export default Service.extend({
  cookies: Ember.inject.service(),
  removeCookies() {
    let cookieService = this.get('cookies');
    cookieService.clear('user');
  }
});

its work in chrome. but not in firefox..
whats wrong..

An in-range update of eslint-plugin-ember is breaking the build 🚨

Version 2.2.0 of eslint-plugin-ember just got published.

Branch Build failing 🚨
Dependency eslint-plugin-ember
Current Version 2.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-ember is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v2.2.0
  • ⭐️ #23 - Improve error messages for order-in rules (@Turbo87)
Commits

The new version differs by 2 commits .

  • e1b99fa 2.2.0
  • e02828d Improved error messages for order-in rules (#23)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of loader.js is breaking the build 🚨

Version 4.2.1 of loader.js just got published.

Branch Build failing 🚨
Dependency loader.js
Current Version 4.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As loader.js is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 3 commits .

  • 52080b2 release v4.2.1
  • 9b88633 Merge pull request #108 from ember-cli/fix-the-world
  • 9d88818 [Fixes #106] include all the files we actually need

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Fastboot causes double decoding

when reading cookies in with fastboot they are being uri decoded twice causing an error if the cookie contains a %. This happens because fastboot uses the cookie package to parse the headers and add to the request object https://github.com/ember-fastboot/fastboot/blob/5a42df54ce3359a33589173d9c79a2236e619ba1/src/fastboot-request.js#L52 cookie calls decodeURIComponent by default when parsing https://www.npmjs.com/package/cookie#decode the value is then decoded again by ember-cookies https://github.com/simplabs/ember-cookies/blob/master/addon/services/cookies.js#L207.

a simple reproduction is

if (!this.fastboot.isFastBoot) {
  this.cookies.write('broken', '%')
}

this.cookies.read('broken')

I know there is a raw option i cannot use this since i'm using ember-cimple-auth. However i also don't think the current behavior is correct regardless since it would require it to be encoded on write and raw on read. I also don't think it would ever be the correct behavior to double decode something since this would change the format unexpectedly if someone intentionally double encoded something for some reason or if it similarly contained a restricted character.

I think the correct fix would be to never use decodeURIComponent when in fastboot

I am happy to submit a PR for this if you agree with the approach

for now my workaround is

_decodeValue(value, raw) {
  if (isNone(value) || raw) {
    return value;
  } else {
    try {
      return decodeURIComponent(value)
    } catch (error) {
      return value
    }
  }
}

This is obviously not great though since it overrides a private method and does not actually handle the double encoding problem but it solved my particular situation

Release #149

Hi,

Could you release a new version with the latest patchs (including #149) ?

Thank you.

An in-range update of ember-cli-htmlbars is breaking the build 🚨

Version 1.3.1 of ember-cli-htmlbars just got published.

Branch Build failing 🚨
Dependency ember-cli-htmlbars
Current Version 1.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-htmlbars is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 4 commits0.

  • b46eb48 v1.3.1
  • f0c03ec Merge pull request #109 from ember-cli/use-non-deprecated-version-checker-api
  • faf7f25 Add yarn.lock.
  • 1b27f67 Update ember-cli-version-checker use to avoid deprecated APIs.

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-disable-prototype-extensions is breaking the build 🚨

Version 1.1.2 of ember-disable-prototype-extensions just got published.

Branch Build failing 🚨
Dependency ember-disable-prototype-extensions
Current Version 1.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-disable-prototype-extensions is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 7 commits.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

DEPRECATION: Use of `merge` has been deprecated.

in my project with ember-fastboot I have this deprecation error

DEBUG: -------------------------------
DEBUG: Ember             : 3.6.1
DEBUG: Ember Data        : 3.6.0
DEBUG: Ember Simple Auth : 1.8.0
DEBUG: -------------------------------

image

An in-range update of ember-cli-eslint is breaking the build 🚨

Version 3.1.0 of ember-cli-eslint just got published.

Branch Build failing 🚨
Dependency ember-cli-eslint
Current Version 3.0.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-eslint is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/simplabs/ember-cookies/builds/228476523?utm_source=github_status&utm_medium=notification)

Release Notes v3.1.0
  • Use new group option of broccoli-lint-eslint by default (#176)
Commits

The new version differs by 50 commits0.

  • 21be33a 3.1.0
  • 67a0cc5 3.1.0-beta.2
  • 5e256a0 Merge pull request #180 from Turbo87/auto-dist-tag
  • 10465b0 CI: Use "auto-dist-tag" for deployment
  • 2ea7d00 Merge pull request #171 from cibernox/update-to-latest-ember-cli-beta
  • 56a3b48 Update to ember-cli 2.13
  • f6e86ba 3.1.0-beta.1
  • 0ece8a2 Update CHANGELOG
  • 1e8eeec README: Add "Configuration" section
  • 41962c4 Merge pull request #176 from Turbo87/group-option
  • 4abd4c1 Use new "group" option by default
  • 80d820a Use new create() factory function
  • 69e25b1 Adjust expected console output
  • a043763 Remove unused "js-string-escape" dependency
  • 61fdfbc Use built-in "broccoli-lint-eslint" test generators

There are 50 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Should `ember-lodash` be a dependency?

Hi,

I installed ember-cookies in a fresh project but got an error on run-time saying that lodash was not found in the cookies service. I had to manually add ember-lodash to my project's devDependencies for it to work.

Thanks,
Jorge L

An in-range update of ember-cli-babel is breaking the build 🚨

Version 5.2.3 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 5.2.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 3 commits .

  • 8d5d130 5.2.3
  • ef7119b Merge pull request #110 from babel/rwjblue-patch-1
  • a655d8a Update minimum version of broccoli-babel-transpiler.

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-cli-app-version is breaking the build 🚨

Version 2.0.2 of ember-cli-app-version just got published.

Branch Build failing 🚨
Dependency ember-cli-app-version
Current Version 2.0.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-app-version is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 2 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of ember-cli-shims is breaking the build 🚨

Version 1.1.0 of ember-cli-shims just got published.

Branch Build failing 🚨
Dependency ember-cli-shims
Current Version 1.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-shims is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Cookies overwrite each other in FastBoot

I've been debugging an authentication issue in our app in FastBoot using ember-simple-auth. Essentially, if you write more than one cookie in FastBoot, the FastBoot Express middleware will only return the last cookie, overwriting the previous cookie each time a new one is added. This particularly affects ember-simple-auth, where if you set an expiration date on your auth cookie, the expiration cache cookie will overwrite your auth cookie, preventing proper authentication.

It's trivial to replicate by writing several cookies in FastBoot and checking the response. You should see a single set-cookie header with the last cookie written.

I personally don't think ember-cookies is doing anything wrong. The way FastBoot provides an API to append headers vs the way it then sets them seems inconsistent. I've opened an issue with more info ember-fastboot/fastboot-express-middleware#33 to hopefully get some feedback on what the intended behaviour is.

Add read/write-throgh cache

A read/write-through cache is needed to mimic browser behavior in FastBoot so that cookies can be read after they have been written. That's not possible out of the box as in FastBoot, cookies are read from the request and written to the response so that cookies that have just been written cannot be read afterwards in the context of the same request.

TODO

  • add read/write-through cache so that cookies that have just been written can be read again in FastBoot
  • take domain, path and expiration info into account so that cookies that have been written for a different domain or path or that have already expired would not be read from the cache; also secure cookies should not be readable when the current request is not via HTTPS - these are clearly edge cases but when going to some lengths to mimic browser behavior these should be handled for consistency

Working with objects, serialization & defaults

In my production app RiskMap, we store a lot of cookie information. We like to store certain values in objects for the sake of tidiness, and because it's logical that all data stored in the same object should expire at the same time.

Currently, updating cookie objects is a multi-step process, parsing and stringifying back-and-forth:

let myCookie = this.get('cookies').read('my-cookie');
myCookie = Ember.Object(JSON.parse(myCookie));
myCookie.set('foo-bar', true);
myCookie = JSON.stringify(myCookie);
this.get('cookies').write('my-cookie', myCookie, { maxAge: defaultCookieMaxAge });

This is a pattern we use a lot at RiskMap, so I've extended Ember Cookies to make working with objects easier and more DRY. TL;DR, the above example becomes:

this.get('cookies').writeObjProperty('myCookie', 'fooBar', true);

@marcoow @Turbo87, I'd be interested to know whether you'd be interested in merging some of the following features into Ember Cookies:

Configuration

Serialization

A global way of serializing cookie name and property keys so camel cased attributes can be used in js, but cookie JSON stored in a consistent manner.

// config/environment.js
ENV['ember-cookies'] = {
  serializer: 'dasherize'
}

Default max age/expires

Our user session is set to expire after 30 days. We want most of our other cookies to expire after that, too. The default value can be expressed either as defaultMaxAge or defaultExpires.

// config/environment.js
ENV['ember-cookies'] = {
  defaultMaxAge: 60 * 60 * 24 * 30,
  defaultExpires: 60 * 60 * 24 * 30
}

Object methods

readObj

readObj reads the cookie, automatically parses the object to JSON and asserts whether it is a valid object.

this.get('cookies').readObj('myCookie');
// returns Ember.Object instance || null

readObjProperty

readObjProperty returns the property value from the cookie object.

this.get('cookies').readObjProperty('myCookie', 'fooBar');
// => returns parsed value

Because all cookie objects are parsed into Ember Object instances, we can get deep property values using dot notation:

this.get('cookies').readObjProperty('myCookie', 'fooBaz.isGettable');

writeObj

writeObj asserts whether a POJO or Ember Object instance is passed and stringifies it as JSON before writing:

this.get('cookies').writeObj('myCookie', { fooBar: true }/*, options*/);
// "my-cookie" === { "foo-bar": true }

writeObjProperty

writeObjProperty enables updating an individual property inside a cookie object:

this.get('cookies').writeObjProperty('myCookie', 'fooBar', false/*, options*/);
// "my-cookie" === { "foo-bar": false }

clearObj

clearObj is just an alias for clear, for the sake of consistency.

this.get('cookies').clearObj('myCookie'/*, options*/);
// my-cookie === null

clearObjProperty

clearObjProperty simply sets a property to null, before stringifying and writing.

this.get('cookies').clearObjProperty('myCookie', 'fooBar'/*, options*/);
// "my-cookie" === { }

Deprecation: Addon files in /addon but no preprocessors

With version 0.1.0 I get:

DEPRECATION: Addon files were detected in .../node_modules/ember-simple-auth/node_modules/ember-cookies/addon, but no JavaScript preprocessors were found for ember-cookies. Please make sure to add a preprocessor (most likely ember-cli-babel) to in dependencies (NOT devDependencies) in ember-cookies's package.json.

Clear method drops any options that are passed to it

The clear method seems to be dropping any options, specifically path, that are passed to it.

It does successfully set the expires option and passes it on the write method but, in my case, path is not getting passed on to the write method.

I am able to work around it by just calling the write method and setting the expire option as clear does, and write still accepts my desired path; However, it would be desirable if clear functioned as described in the documentation.

  • Thanks

Addon causes linked apps to error during build. "Babel loaded v6.x.x"

I have been having issues using the latest release, v0.4, inside an addon that is linked to another app.
Steps:

  1. The addon and app have version ember-cookies: 0.4 set as a dependency.
  2. Inside the addon I yarn link
  3. Inside the app I yarn link addon
  4. I ember s in the app and get this error:
Build Error (broccoli-persistent-filter:Babel > [Babel: ember-cookies]) in ember-cookies/clear-all-cookies.js

Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.

What I think is happening is that another addon/dependency has Babel 6 declared as a dependency. This is causing the build to sometimes load Babel 6 and not Babel 7.

I ended up downgrading.
Any ideas what can be done?

An in-range update of ember-cli-babel is breaking the build 🚨

Version 5.2.2 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 5.2.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 5 commits .

  • 5526d86 5.2.2
  • cc9942a Merge pull request #108 from babel/add-annotation
  • 74c4723 Add more detailed annotation.
  • 10dc1cd Merge pull request #107 from twokul/patch-1
  • 54db09a Brocfile.js -> ember-cli-build.js

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

"=" in cookie value causes ember-cookies to not see the cookie

When a valid cookie is set that contains = in the value it doesn't work. We discovered this issue because our session cookies always end in =.

document.cookie shows that the cookie is in fact present, meanwhile…
cookies.exists('session') returns false
cookies.read('session') returns undefined

It looks like the issue is where it splits the cookies by "=" and asserts that the length is === 2.
https://github.com/simplabs/ember-cookies/blob/5f83b8486ee19da877cea5c164962ec33c725e5f/addon/services/cookies.js#L196

I'm not sure if there are other edge cases here, but one solution could be to use >= 2 instead. Alternatively you could manually assemble the key and value by doing something like unfilteredCookies.map(c => [c.slice(0, c.indexOf('=')), c.slice(c.indexOf('=') + 1)]).filter(...).

Feature Request: Add expires shortcuts?

carhartl/jquery-cookie and js-cookie both provided a shortcut to expiration. If you provided expires: <Number>, then it would assume an expiration of days. Would you be agreeable to this sort of feature in ember-cookies?

We could also enhance this significantly by supporting a String value specifying a duration and units. Maybe use the same characters as date formatting to specify units? ex: '3d' or 50M for 3 days or 50 minutes respectively

Thanks for the addon! Loving it and killing off a jquery plugin and bower dependency!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.