Comments (3)
I'd be interested to hear more as to why you say storing objects in cookies isn't advisable
You might run into problems with max cookie size, having to migrate data in cookies etc. In general you want to store only enough information in a cookie to be able to restore your full state from that. For more advanced things it's probably better to use localStorage
or sessionStorage
or even things like IndexedDB
or so.
and whether you think it'd be worth me authoring an accompanying plugin - something like Ember Cookies Object Store?
I think everything's worth exploring ;)
from ember-cookies.
Thanks for the great writeup!
I honestly don't believe this is something that belongs in ember-cookies though. The idea behind ember-cookies is really to provide a low level cookies API that works both in the browser as well as in Node. Introducing functionality that allows using cookies as an object store that also has to deal with serialization etc. introduces a lot of additional complexity that just isn't necessary for the majority of use cases. Also using cookies in this way isn't actually advisable I'd argue (there might be edge cases in which doing this is actually fine and your app might be one of these edge cases) and I don't think we should advocate this kind of usage by providing dedicated APIs for it.
from ember-cookies.
@marcoow I totally understand that and in fact I thought that would be the case!
I'd be interested to hear more as to why you say storing objects in cookies isn't advisable and whether you think it'd be worth me authoring an accompanying plugin - something like Ember Cookies Object Store?
from ember-cookies.
Related Issues (20)
- Expire On Cookie HOT 1
- DEPRECATION: Use of `merge` has been deprecated HOT 2
- An in-range update of ember-cli-babel is breaking the build 🚨 HOT 3
- Fastboot causes double decoding HOT 2
- Addon causes linked apps to error during build. "Babel loaded v6.x.x" HOT 1
- npm deploy build step failed HOT 2
- `Cannot read property 'split' of undefined` error in tests when upgrading to ember 3.13.0 HOT 1
- [0.5.1 Regression] TypeError: Cannot read property 'isFastBoot' of undefined HOT 1
- Add SameSite=None support (and UA check?) HOT 3
- nodetest task HOT 1
- Setting max age in FastBoot
- Add a timeout to CI GitHub workflow for test step
- cookies not working
- Dependency Dashboard
- Cut new release HOT 3
- Convert addon to V2 HOT 2
- TypeError: can't access dead object HOT 2
- Ember v5 - current ember-canary, ember-beta channels are failing under fastboot HOT 1
- [Embroider] Fails under fastboot in embroider-optimized scenario
- Action Required: Fix Renovate Configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cookies.