You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2004/06/10 14:23:12 UTC

DO NOT REPLY [Bug 29493] New: - Cookie Manager doesn't remove expired cookies

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29493>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29493

Cookie Manager doesn't remove expired cookies

           Summary: Cookie Manager doesn't remove expired cookies
           Product: JMeter
           Version: 2.0.0
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Major
          Priority: Other
         Component: HTTP
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: timothy.rundle@volvo.com


The Cookie Manager doesn't removes an existing cookie that has been set to 
expired. This bug can be reproduced by creating a script with 3 HttpSampler 
calls. Have the first HttpSample call a page that issues a valid transient 
cookie.  Have the second HttpSampler call abother page that re-issues the 
cookie with an expired timestamp, which should remove the cookie.  However, 
when the third HttpSampler is called the cookie is sent in the request.
  I believe the bug is a combination of line 344 and lines 362-367 of the 
CookieManager.  On line 344 the default expiration time is set for 24 hrs. 
from now. That value is only change on lines 362-367 when the expired date is 
in the future.  There is even a TODO comment questioning this logic.  As a 
result the timestamp will never be in the past so the cookie will never be 
removed.  I beleive this can be fixed by removing the conditional statement 
and always set the Expires field of the cookie if an expiration date exists in 
the header.

Code Update (lines 362-367):
//                if (date.getTime() > System.currentTimeMillis())
                        //TODO: why this conditional? If it's expired, it's
                        // expired!
//                  {
                        newCookie.setExpires(date.getTime());
//                  }

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org