Create the following panorama:

In the BeanShell pre-processor, put:
import org.apache.jmeter.protocol.http.control.CookieManager; import org.apache.jmeter.protocol.http.control.Cookie; CookieManager manager = sampler.getCookieManager(); Cookie cookie = new Cookie("toto","titi","localhost","/",false,0); manager.add(cookie);
Please note that using JSR223 PreProcessor + Groovy + Caching would be better to execute
source share