To manually add a header, use the Filters
tab and use the Request Headers
section.
To automatically add a header, click Rules > Customize Rules. Scroll to OnBeforeResponse
and write code that stores the target cookie in a global variable declared just inside the Handlers
function, e.g.
static var m_MyCookie: String;
Then, inside the OnBeforeRequest
function, use that variable, e.g.
if (!String.IsNullOrEmpty(m_MyCookie)) oSession.oRequest["Cookie"] = (m_MyCookie + ";" + oSession.oRequest["Cookie"] )
If you're only trying to add this header to specific requests, use, for instance, the oSession.uriContains
function to determine whether the target URL is one that you want to have the cookie.