javascript delete cookie

To delete a cookie in Node.js using JavaScript, you can follow these steps:

  1. Access the request object to get the cookies using req.cookies.
  2. Set the cookie that needs to be deleted to a value of 'null' using res.cookie('cookieName', null, { maxAge: 0 }).
  3. Send the response back with the updated cookie using res.send('Cookie deleted').