Features
Cookies

Cookies

Create Cookies

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

img

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

  • From the Request Pre Run tab you can check Clear Cookies option, This will clear cookies for the current domain
  • Clear All Cookies: From Cookies tab on the right, click Clear All to remove all cookies from 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

// 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);