Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2863

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.8
    • 1.4.11, 1.5-M2.1
    • wicket
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              pojo Ben La Monica
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: