DenoDDeno
Powered by
captainbuckketsC
Denoβ€’2y agoβ€’
3 replies
captainbuckkets

Removing cookie for basic logout

I seem to be losing my mind. My logout pathway used to work, but now no matter what method I use, the cookie remains and

a) the cookie is never removed
b) the user can't actually logout as a consequence

Here is a simple pathway using both the .88 STD methods, and the Oak library

deleteCookie(response, "token")
cookies.delete("token", "");
await cookies.set("token", "",)

// response.status = 302;
// response.headers.set("Location", "/");
response.redirect("/login")
deleteCookie(response, "token")
cookies.delete("token", "");
await cookies.set("token", "",)

// response.status = 302;
// response.headers.set("Location", "/");
response.redirect("/login")
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

setting a cookie for import requests
cyzyvosCcyzyvos / help
3y ago
Cookie issues
TheOneThatPlaysTooMuchTTheOneThatPlaysTooMuch / help
13mo ago
Basic CRUD API
bAILEYBbAILEY / help
2y ago