-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (28 loc) · 898 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import repoLink from "../../components/repo-link.js";
export default {
title: "Deleting cookies",
metaDescription: "Delete an HTTP cookie",
page: function () {
return `
<section>
<h1>Delete HTTP cookies</h1>
<p>Use an Edge Function to delete cookies.</p>
<pre><code>import type { Context } from "https://edge.netlify.com";
export default async (request: Request, context: Context) => {
// Delete a cookie
context.cookies.delete("My cookie");
};</code></pre>
<h2>See this in action</h2>
<ul>
<li><a href="/cookies?action=clear">Delete a cookie</a></li>
<li>${repoLink("cookies.ts")}</li>
</ul>
<h2>Related</h2>
<ul>
<li><a href="/example/cookies-set">Set the value of a cookie</a></li>
<li><a href="/example/cookies-read">Read the value of a cookie</a></li>
</ul>
</section>
`;
},
};