Comments (3)
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.
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.
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)
- Request for mojito-cli creating templates using Promises HOT 10
- ac.partial.render() throws error for handlebar custom helper HOT 14
- Featurerequest: reviver-method for params.getFromBody-bodyparsing json stringified requests HOT 1
- request for MojitProxy.refreshView() not to reload css-assets HOT 13
- mojito test crashes when require() is used HOT 2
- escape comboBase will cause some combo handler stop working HOT 3
- On middleware registration, pass in the `mojito` object HOT 13
- custom yui module invisible in test HOT 1
- [docs] mojitProxy.invoke() HOT 1
- For some reason I have obtained this issue when i run mojito on windows HOT 2
- Exception on mp.destroyChildren() when used again after refreshView()
- mojito crash when page is reloaded and a mojit invoke() is in progress HOT 1
- Static context not reflected in request's context HOT 4
- ac.error() sends an empty response to binder HOT 1
- Routes exposed to the client HOT 2
- Error : During Dynamic mojit creation HOT 1
- Load custom template view in ac.composite.execute HOT 3
- `mojito start` not working HOT 4
- Switch "express-state" internal module require()
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 mojito.