[ https://issues.apache.org/jira/browse/LABS-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729725#action_12729725 ]
Arianna Giancola commented on LABS-379: --------------------------------------- This issue is not resolved. The first time, if the cookie does not exist already, it still returns an empty value. If the cookie exist, it returns the correct value. > [web] Cookie "lag" > ------------------ > > Key: LABS-379 > URL: https://issues.apache.org/jira/browse/LABS-379 > Project: Labs > Issue Type: Bug > Components: Magma > Affects Versions: Current > Reporter: Simone Gianni > Assignee: Simone Gianni > Fix For: Current > > > A cookie is sent to the browser, and the browser send it back to the server > on the next request. > This has created a difference in cookie handling when compared to other > "state" variables. If a web app writes something in the session, and the > reads it back, it will obtain the latest written value. On the opposite, if > the application writes a cookie, it will still read the "old" (potentially > missing) cookie untile the next request. > IMHO this approach impairs cookie usage. Think for example about storing in a > cookie the preferred user language. When the user clicks on a language, the > corresponding handler will set a cookie, then other components will read that > cookie if present to present their contents in the right language. This > works, except in the same request the user clicked on the language, so you > have to store the new language BOTH as a cookie and as something else (like > session or request attribute) and then multiply checks along the code, which > makes it complex for no real reason. > The situation where you really want to compare en incoming cookie with an > outgoing one is quite rare. > So, it would be better to mask this cookie peculiarity, which is an > implementation side effect, and have cookies behave like "remote session > attributes". -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: labs-unsubscr...@labs.apache.org For additional commands, e-mail: labs-h...@labs.apache.org