Using Jmeter on a system with IPv6 addressing and brings to the issue: HTTP Cookies aren't inserted in the HTTP request. Using the same jmx-test, but with IPv4 addressing, everything works fine. The HTTP Requests are pretty much the same except for the Host header: IPv4: Host: 172.31.61.41:8123 IPv6: Host: [2002::12]:8123 It seems like there is a bug in the way cookies are stored/retrieved for IPv6 hosts. Note: I tried changing the Cookie Policy to all the possible values (rfc2965, etc.). It didn't help. Note2: tried CookieManager.check.cookies=false in jmeter.properties didn't help. Looks like there is no workaround for this bug. == Details: === IPv4: -------- GET /xxx.xxx HTTP/1.1 Connection: keep-alive User-Agent: Java/1.6.0_14 Host: 172.31.61.44:8123 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 -------- HTTP/1.1 200 OK Date: Fri, 08 Jul 2011 23:17:18 GMT Content-Length: 659 Content-Type: text/html; charset=utf-8 Set-Cookie: TS48550d=7c55fc5f609f3263a19d5bf56ba87e4adc1f801ce2a34e724e1744d9; Path=/ Set-Cookie: TS48550d_1=bf7c6f914d6181372dfe392362bf8dc4dc1f801ce2a34e7200c6c833d9e562f258; Path=/ <html><head><style> TABLE, TD { border: 3px solid black; border-collapse: collapse } </style></head> <body><table> <TR><TD>path </TD><TD> /xxx.xxx</TD></TR> <TR><TD>query </TD><TD> </TD></TR> <TR><TD>method </TD><TD> GET</TD></TR> <TR><TD>cookie </TD><TD> </TD></TR> <TR><TD>content_type</TD><TD> </TD></TR> <TR><TD>content </TD><TD> </TD></TR> <TR><TD>as_string </TD><TD><PRE>GET /xxx.xxx HTTP/1.1 Connection: keep-alive Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Host: 172.31.61.44:8123 User-Agent: Java/1.6.0_14 </PRE></TD></TR> </table></body></html> -------- GET /fff.zip HTTP/1.1 Connection: keep-alive Cookie: TS48550d=7c55fc5f609f3263a19d5bf56ba87e4adc1f801ce2a34e724e1744d9; TS48550d_1=bf7c6f914d6181372dfe392362bf8dc4dc1f801ce2a34e7200c6c833d9e562f258 User-Agent: Java/1.6.0_14 Host: 172.31.61.44:8123 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 IPv6: -------- GET /xxx.xxx HTTP/1.1 Connection: keep-alive User-Agent: Java/1.6.0_14 Host: [2002::12]:8123 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 -------- HTTP/1.1 200 OK Date: Fri, 08 Jul 2011 20:37:53 GMT Content-Length: 657 Content-Type: text/html; charset=utf-8 Set-Cookie: TS48550d=d1f940e9b0d067b9e4d9b7870a3b76fed46c8da98c8b21124e171f7e; Path=/ Set-Cookie: TS48550d_1=f2ca831a9781d3a13d30c433d2d18d43d46c8da98c8b211200c6c833d9e562f258; Path=/ <html><head><style> TABLE, TD { border: 3px solid black; border-collapse: collapse } </style></head> <body><table> <TR><TD>path </TD><TD> /xxx.xxx</TD></TR> <TR><TD>query </TD><TD> </TD></TR> <TR><TD>method </TD><TD> GET</TD></TR> <TR><TD>cookie </TD><TD> </TD></TR> <TR><TD>content_type</TD><TD> </TD></TR> <TR><TD>content </TD><TD> </TD></TR> <TR><TD>as_string </TD><TD><PRE>GET /xxx.xxx HTTP/1.1 Connection: keep-alive Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Host: [2002::12]:8123 User-Agent: Java/1.6.0_14 </PRE></TD></TR> </table></body></html> -------- GET /fff.zip HTTP/1.1 Connection: keep-alive User-Agent: Java/1.6.0_14 Host: [2002::12]:8123 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 --------
Created attachment 27467 [details] The fix to FunctionProperty#hashCode The patch as described in previous comment Philippe Mouawad
Sorry, attached patch is not for this issue,
Cookies are stored by the client, not by the server. Report this to your client software project/vendor. The server is sending proper set-cookie headers and the client is ignoring them.
The JMeter Cookie Manager uses HTTPClient API to validate/parse Cookie header. This bug is provide by Httpclient 3.1 which not support host with IPv6 address. https://issues.apache.org/jira/browse/HTTPCLIENT-654 A workaround is use a host header with a name (not ip). The fix is to use HTTPClient 4.x for cookie manager (I works on this).
Thanks Milamber! I currently use hostnames, but it would be great to be able to run the traffic with IPv6 in the Host header. Looking forward for your fix.
Created attachment 28084 [details] Test Plan
Date: Sun Dec 18 15:52:56 2011 New Revision: 1220440 URL: http://svn.apache.org/viewvc?rev=1220440&view=rev Log: Make method exposing HTTPClient object not public (prepare enhancement of CookieManager supporting IPv6 (using HTTPClient4))
Date: Sun Dec 18 21:55:32 2011 New Revision: 1220552 URL: http://svn.apache.org/viewvc?rev=1220552&view=rev Log: Bug 51512 - Cookies aren't inserted into HTTP request with IPv6 Host header First part, introduce interface CookieHandler and make CookieManager use it. Second step will introduce HC4CookieHandler that will enable parsing of IPv6 IPs. Added: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieHandler.java (with props) jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC3CookieHandler.java (with props) Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestCookieManager.java
I think we should fix this one soon according to this: - http://www.google.com/intl/en/ipv6/ World IPv6 Launch on June 6, 2012
See Bug 53755
URL: http://svn.apache.org/viewvc?rev=1376320&view=rev Log: Adding a HttpClient 4 cookie implementation in JMeter. Cookie Manager has now the default HC3.1 implementation and a new choice HC4 implementation (compliant with IPv6 address) and Bug 51512 - Cookies aren't inserted into HTTP request with IPv6 Host header Bugzilla Id: 53755 Added: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java (with props) Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassTools.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java jmeter/trunk/xdocs/changes.xml