Guy
Guy

Reputation: 810

JMeter 5.4.1 Cookie Manager - User-Defined Cookie not added to request's cookies

Firstly, I did add the line CookieManager.check.cookies=false to jmeter.properties.

What I'm Trying to Do

I want to add a cookie to a request's existing cookies.

For example, I see the request has [edited]:

Cookie Data:
c1=sfasfsfsfsfs; c2=erqwerqwrr; c3=poiuopiupoi

Expected Results

I would like it to have:

Cookie Data:
c1=sfasfsfsfsfs; c2=erqwerqwrr; c3=poiuopiupoi; partner=favicon.ico

Here is what I tried: enter image description here

BASE_URL_2 is a variable defined in the form qa.company.com.

Actual Results

Whatever I have tried so far has not made any change in the cookies.

What else shall I try?

Underlying Motivation

Recorded a Web session and played it back. Added a RegEx Extractor to pull out a token and then added it to subsequent requests. That helped. However, certain requests failed with an custom application exception Security violation, please refresh.
Probably session login state is not being passed, so the website thinks the call is "stale".
I've seen this on the GUI when the session expires and you try to click a button on the site.

On comparing the cookies seem in JMeter with what I saw in the Chrome Debugger, it was clear that there were more cookies in the running application than what I had in JMeter.

Upvotes: 0

Views: 532

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

Are you sure you're using HTTPS protocol because if you have secure flag and using HTTP protocol - the cookie will not be sent.

Also remove = from partner= otherwise you will end up with partner==favicon.ico

enter image description here

Demo:

enter image description here

More information:

Upvotes: 2

Related Questions