Giter VIP home page Giter VIP logo

Comments (3)

aljimenez avatar aljimenez commented on June 26, 2024

Hi,

Thanks for reporting this. To my understanding this is the expected behavior; ac.cookie.get gets the cookies from the request, whereas ac.cookie.set sets new cookies for the response. So when you call ac.cookie.set the client will get the new cookie, but when you call ac.cookie.get right after, the cookies returned should be the original set of cookies that the client sent, not the new cookies that will be sent back. This is slightly different from what you would expect when using Y.Cookie on the client side. Let me know if you have any questions.

Thanks,
Albert

from mojito.

d-adamkiewicz avatar d-adamkiewicz commented on June 26, 2024

Hi,
Thank you for the anwser. What I try to do is to make sure whether cookie was set (and its value) or not in single execution of server controller code where app logic needs this confimation because I want link some server stored data with it - ie implement sessions.btw. implementation ac.cookie.get() changed recently? Mojito sessions https://github.com/akshar100/mojito-session addon which was starting point for me uses it "wrong way".

from mojito.

aljimenez avatar aljimenez commented on June 26, 2024

Based on the history of cookie.server.js, the implementation has been the same since 2012. I am not familiar with mojito-session, but if you end up creating your own solution, you may consider open sourcing it so others can benefit from it.

from mojito.

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.