How to extract sessionid from cookie data in jmeter?

26 Views Asked by At

The response is: Set-Cookie: sessionid=YUuyisdjif7njdibvck89987hgfdghjuytrdtyRB==;

I want to extract this sessionid to use it in further response.

1

There are 1 best solutions below

0
Ivan G On

The easiest way is using HTTP Cookie Manager's built-in capability of saving cookies into JMeter Variables.

  1. Add the next line to user.properties file (lives in "bin" folder of your JMeter installation)

    CookieManager.save.cookies=true
    
  2. Restart JMeter to pick up the change

  3. Add HTTP Cookie Manager to your test plan

  4. That's it, you should be able to refer the cookie's value as ${COOKIE_sessionid} where required

More information: HTTP Cookie Manager Advanced Usage - A Guide