Bug 60986 - CookieManager User-defined cookies aren't saved as variables
Summary: CookieManager User-defined cookies aren't saved as variables
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.1
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-13 16:59 UTC by Wyatt Epp
Modified: 2017-04-19 19:26 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wyatt Epp 2017-04-13 16:59:36 UTC
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.