apache / apache/jmeter

CookieManager User-defined cookies aren't saved as variables

Open
#4,359 0 comments 0 reactions 0 assignees View on GitHub
enhancement os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Wyatt Epp** ([Bug 60986](https://bz.apache.org/bugzilla//show_bug.cgi?id=60986&redirect=false)):
Setting CookieManager.save.cookies=true does not expose User-Defined Cookies as variables. This is very inconvenient, because the only way to get those values otherwise (for example, if we want to pass them to the backend listener) is to use a JSR223 post-processor from an HTTP sampler (otherwise, the CookieManager is not available) and do one of three suboptimal things:

1. Import o.a.j.p.h.c.Cookie/CookieManager and loop iterate over the cookies by index. (Notably, doesn't work if the cookie value is variable.)

2. Use regular-expression hacks on the output of CookieManager.getCookieHeaderForURL() to extract the value.

3. Import the correct HttpClient CookieHandler and iterate over the list returned from CookieHandler.getCookiesForUrl().

The CookieManager should make the _current value_ of a cookie available at all times when that property is set.

OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.