In my JMeter test plan, my app is generating two cookies "XSRF-Token" and "laravel_session". In one thread i have login request and another thread have internal pages. I have defined the HTTP COOKIES Manager at test plan level but not working. Then I have tried with BeanShell pre-processor and post-processor here is my code: Beanshell post processor in login thread:
props.put("MyCookie","${COOKIE_XSRF-TOKEN}");
props.put("MyCookie1","${COOKIE_laravel_session}");
Beanshell pre-processor in another thread:
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.Cookie;
CookieManager manager = sampler.getCookieManager();
Cookie cookie = new Cookie("XSRF-TOKEN",props.get("MyCookie"),"mydomain","/",true,0);
manager.add(cookie);
Cookie cookie1 = new Cookie("laravel_session",props.get("MyCookie1"),"mydomain",/",true,0);
manager.add(cookie1);
Any idea how can I manage multiple cookies and set them so my next thread can run properly?