MockHttpServletResponse does not save Session cookies (maxAge = -1)
-------------------------------------------------------------------

                 Key: WICKET-2863
                 URL: https://issues.apache.org/jira/browse/WICKET-2863
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.8
            Reporter: Ben La Monica


The WicketTester does not save cookies that have an age of -1 (the default if 
you do not set a maxAge). These cookies should be treated as session cookies 
and should be deleted when the browser exits (or in this case, when the 
WicketTester browsing session is thrown away). This used to work in 1.4.1, but 
fails to work in 1.4.8. I believe that the fix introduced by WICKET-2630 causes 
this behavior.

The description in WICKET-2630 only quotes part of the javadoc for Cookies. The 
actual javadoc 
(http://java.sun.com/javaee/6/docs/api/javax/servlet/http/Cookie.html#setMaxAge%28int%29)
 reads:

A positive value indicates that the cookie will expire after that many seconds 
have passed. Note that the value is the maximum age when the cookie will 
expire, not the cookie's current age.

A negative value means that the cookie is not stored persistently and will be 
deleted when the Web browser exits. A zero value causes the cookie to be 
deleted. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to