Languages
[Edit]
EN

Express.js - delete cookie

0 points
Created by:
Wesley
501

In this short article, we would like to show you how to delete cookies in Express.js.

Note:

To be able to work with cookies in Express.js, we will use cookie-parser middleware, so use:

 

Delete cookie example

Edit

To delete cookies, we use response.clearCookie() method with specified cookie name (username).

 Before:

Above we have cookie username = john
Above we have cookie username = john

After:

After entering localhost:3000/clear-cookie

See also

Edit
  1. Express.js - add cookie 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join