vscode-restclient icon indicating copy to clipboard operation
vscode-restclient copied to clipboard

Empty cookie for some requests

Open raman-kazhadub opened this issue 1 year ago • 1 comments

Is there any way to set empty cookie header for request?

raman-kazhadub avatar Nov 29 '23 11:11 raman-kazhadub

Implement a new endpoint that sets a cookie with empty value and expiration with a past date

The next example uses express with cookie-parser

// In your server

async function cleanCookie(response) {
  response
  .cookie('cookie_name', '', { expires: new Date(0) })
  .json({ message: 'success' })
}
### Sign out example
POST http://localhost:3000/clean-cookie

Usually if you're doing an auth system this must be in the 'sign out' endpoint

wokcito avatar Feb 04 '24 23:02 wokcito