Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/k6/next/javascript-api/k6-http/cookiejar/cookiejar-delete.md (append .md) or send Accept: text/markdown to /docs/k6/next/javascript-api/k6-http/cookiejar/cookiejar-delete/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
Menu
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Open source
CookieJar.delete(url, name)
| Parameter | Type | Description |
|---|---|---|
| url | string | The URL to delete cookies for. |
| name | string | The name of the cookie you want to delete. |
Example
JavaScript
import http from 'k6/http';
import { check } from 'k6';
export default function () {
const jar = http.cookieJar();
jar.set('https://quickpizza.grafana.com/api/cookies', 'my_cookie_1', 'hello world_1');
jar.set('https://quickpizza.grafana.com/api/cookies', 'my_cookie_2', 'hello world_2');
const res1 = http.get('https://quickpizza.grafana.com/api/cookies');
check(res1, {
'res1 has status 200': (r) => r.status === 200,
"res1 has cookie 'my_cookie_1'": (r) => r.json().cookies.my_cookie_1 !== null,
'res1 cookie has correct value_1': (r) => r.json().cookies.my_cookie_1 == 'hello world_1',
"res1 has cookie 'my_cookie_2'": (r) => r.json().cookies.my_cookie_2 !== null,
'res1 cookie has correct value_2': (r) => r.json().cookies.my_cookie_2 == 'hello world_2',
});
jar.delete('https://quickpizza.grafana.com/api/cookies', 'my_cookie_1');
const res2 = http.get('https://quickpizza.grafana.com/api/cookies');
check(res2, {
'res2 has status 200': (r) => r.status === 200,
"res2 doesn't have cookie 'my_cookie_1'": (r) => r.json().cookies.my_cookie_1 == null,
"res2 has cookie 'my_cookie_2'": (r) => r.json().cookies.my_cookie_2 !== null,
'res2 cookie has correct value_2': (r) => r.json().cookies.my_cookie_2 == 'hello world_2',
});
}Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

Performance testing and observability in Grafana Cloud
Optimize user experiences with Grafana Cloud. Learn real-time insights, performance testing with k6, and continuous validation with Synthetic Monitoring.
Events

User-centered observability: load testing, real user monitoring, and synthetics
Learn how to use load testing, synthetic monitoring, and real user monitoring (RUM) to understand end users' experience of your apps. Watch on demand.
Choose a product
Viewing: next
Find another version
Scroll for more