You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2016/06/01 18:00:29 UTC

[Bug 59651] New: HTTP Cookie Manager not passing csrftoken parameter

https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

            Bug ID: 59651
           Summary: HTTP Cookie Manager not passing csrftoken parameter
           Product: JMeter
           Version: 3.0
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: jfo.sqa@gmail.com

Web app generates both JSESSIONID and csrftoken as cookies.

Add HTTP Cookie Manager
Settings:
Clear Cookies each iteration
Policy = compatibiloty
Implementation = HC3CookieHandler

In HTTP Request add parameter
Name = csrftoken
Value = ${COOKIE_csrftoken}

When running this test in JMeter 2.13 the csrftoken variable is resolving as
expected and the request succeeds.

When running this test plan in JMeter 3.0 the csrftoken variable is not being
resolved and the request fails.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #4 from jfo.sqa@gmail.com ---
Created attachment 33905
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33905&action=edit
jmeter3_logfile

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #6 from jfo.sqa@gmail.com ---
In test plan HTTP Req 12 = the Initial Login, JSESSIONID is generated. Req 49
is where the csrftoken is added to the cookie. 
Req 48 is where the csrftoken is used and is failing

SamplerProperties:
HTTPSampler.DO_MULTIPART_POST=false
HTTPSampler.auto_redirects=false
HTTPSampler.concurrentPool=4
HTTPSampler.connect_timeout=
HTTPSampler.contentEncoding=
HTTPSampler.cookie_manager=org.apache.jmeter.protocol.http.control.CookieManager@3aadf3f1
HTTPSampler.domain=localhost
HTTPSampler.embedded_url_re=
HTTPSampler.follow_redirects=true
HTTPSampler.header_manager=org.apache.jmeter.protocol.http.control.HeaderManager@4f72a9aa
HTTPSampler.method=GET
HTTPSampler.monitor=false
HTTPSampler.path=/vestmark/servlet/viviport/action/Dispatcher/nocacheid/1464806184676/hsid/6f4f91d064c788355b1bc64dd0514e09
HTTPSampler.port=8080
HTTPSampler.protocol=http
HTTPSampler.response_timeout=
HTTPSampler.use_keepalive=true
HTTPsampler.Arguments=componentType=portlet.application.console()&componentId=1269()&componentAction=getDashboard()&widgetListId=primaryTab2-WidgetList()&csrftoken=${COOKIE_csrftoken}()
TestElement.enabled=true
TestElement.gui_class=org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui
TestElement.name=48
/vestmark/servlet/viviport/action/Dispatcher/nocacheid/1463515254913/hsid/25c82edb13162cfee0b568733f381575
TestElement.test_class=org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy
TestPlan.comments=

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #7 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Thanks but in order to investigate, we need to have the >>>>>response<<<<
headers of request that contains the CSRF Token, not the one that uses the
COOKIE_csrftoken.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #2 from jfo.sqa@gmail.com ---
Yes, I've set Implementation = HC4CookieHandler and Policy = standard.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
                 OS|                            |All

--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Did you select standard policy with hc4cookiehandler in 3.0 ?

If not that is probably your problem.

Regards
Philippe M.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #8 from jfo.sqa@gmail.com ---
This is the response header for the thread that returns the csrftoken:

Response headers:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"61-1464269441221"
Last-Modified: Thu, 26 May 2016 13:30:41 GMT
Content-Type: text/html
Content-Length: 61
Date: Wed, 01 Jun 2016 19:37:35 GMT

This is in the request header for that thread:
Connection    keep-alive

Accept-Language    en-US,en;q=0.5
Accept-Encoding    gzip, deflate
User-Agent    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101
Firefox/44.0
Accept    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Host    test0007:8080
Cookie    JSESSIONID=34094CB68585965386B657E81D335C0E.node01;
csrftoken=fof9y7Jehr0EQgQuOhfj6PSGMmDCpKGBuCqKKth1cmaltKQbaTltBeWhR89ZDwWW4wHQYJ54ZRMXR1oVBHTfp1G

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #5 from jfo.sqa@gmail.com ---
Created attachment 33906
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33906&action=edit
simplified_login_testplan

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

jfo.sqa@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #10 from jfo.sqa@gmail.com ---
That was it, I neglected to update my user.properties file when updating. Sorry
for the static.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #3 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
can you attach your simplified test plan and also response that you receive
from server including headers.
Please also attach jmeter.log

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 59651] HTTP Cookie Manager not passing csrftoken parameter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59651

--- Comment #9 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Did you set in user.properties:

CookieManager.save.cookies=true

-- 
You are receiving this mail because:
You are the assignee for the bug.