You can add "JSR223 PostProcessor" as the child of your sampler. Then put
the following code in the script, now you can change the domain of all your
cookies to the new domain.
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.Cookie;
CookieManager manager = sampler.getCookieManager();
int count = manager.getCookieCount();
for(int i=0;i<count;i++){
Cookie cookie = manager.get(i);
cookie.setDomain(vars.get("domain"));
}
2017-06-02 6:57 GMT+08:00 Antony Bowesman <
[email protected]>:
> Hi,
>
> I am using JMeter 3.1, HttpClient4 and HC4CookieHandler and after login am
> getting .ASPXAUTH cookies sent to me for domain
>
> api.xxx
>
> Our real clients are then sending those cookies back to
>
> services.xxx
>
> which then talks to api.xxx and of course forwards the cookies.
>
> However, jmeter is (correctly) not sending the cookie from api.xxx back to
> services.xxx, so when the request goes internally to api.xxx that thinks I
> am not logged in.
>
> Is there any way I can get JMeter to send those cookies back to the non
> originating domain?
>
> Cheers
> Antony
>
>
--
Best Regards
Wei