Create Cookies

  • You can create or modify cookies using the Cookie header in the request
  • Cookies are separated by ;


Create Cookies from scripting

// set cookie for current url
await tc.setCookie("https://www.thunderclient.com", "cookieName", "cookieValue");
await tc.setCookie(tc.request.url, "cookieName", "cookieValue");

Clear Cookies

  • In the Pre Run tab of the request, you can enable the Clear Cookies option. This will clear cookies for the current domain.
  • To clear all cookies, navigate to the Cookies tab on the right, then click Manage Cookies to remove all cookies from the store.

Clear Cookies from scripting

// clear all cookies in store
await tc.clearCookies();
// clear all cookies for current domain
await tc.clearCookies("url");
await tc.clearCookies(tc.request.url);
// clear single cookie by name of cookie
await tc.clearCookies(tc.request.url, "cookieName");

View Cookies

  • To view cookies, navigate to the Cookies tab on the right and click Manage Cookies to see all cookies.

View Cookies from scripting

// get all cookies in store
var list = await tc.getCookies();
// get all cookies for current url
var listDomain = await tc.getCookies("url");
var listDomain = await tc.getCookies(tc.request.url);