Giter Site home page Giter Site logo

Comments (3)

marcoow avatar marcoow commented on August 18, 2024 1

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.

marcoow avatar marcoow commented on August 18, 2024

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.

willviles avatar willviles commented on August 18, 2024

@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)

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.