labs-labs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Gianni (JIRA)" <j...@apache.org>
Subject [jira] Created: (LABS-379) [web] Cookie "lag"
Date Fri, 10 Jul 2009 00:20:14 GMT
[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-unsubscribe@labs.apache.org
For additional commands, e-mail: labs-help@labs.apache.org


Mime
View raw message