You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org> on 2011/12/13 15:05:31 UTC

[jira] [Resolved] (WICKET-4292) MockHttpServletResponse.addCookie(Cookie) adds duplicate cookies

     [ https://issues.apache.org/jira/browse/WICKET-4292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4292.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0
                   1.5.4
    
> MockHttpServletResponse.addCookie(Cookie) adds duplicate cookies
> ----------------------------------------------------------------
>
>                 Key: WICKET-4292
>                 URL: https://issues.apache.org/jira/browse/WICKET-4292
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>             Fix For: 1.5.4, 6.0.0
>
>
> org.apache.wicket.protocol.http.mock.MockHttpServletResponse.addCookie(Cookie) makes a bad check whether the cookie to be added is already in the list of cookies.
> Since javax.servlet.http.Cookie doesn't implement #equals() "cookies.remove(cookie)" wont remove the previous cookie because the identity is different.
> According to http://www.ietf.org/rfc/rfc2109.txt, p.4.3.3 :
>  If a user agent receives a Set-Cookie response header whose NAME is
>    the same as a pre-existing cookie, and whose Domain and Path
>    attribute values exactly (string) match those of a pre-existing
>    cookie, the new cookie supersedes the old.  However, if the Set-
>    Cookie has a value for Max-Age of zero, the (old and new) cookie is
>    discarded.  Otherwise cookies accumulate until they expire (resources
>    permitting), at which time they are discarded.
> I.e. the equality is on the name, path and domain.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira