I need to remove all cookies of sails js, but i didn't find documentation. The problem is that the authentication is with token and no with cookies however the cookie is generated when make a request to the server in sails js. I need disabled creation of cookies in sails. Thanks
You can disable sessions in Sails, that should disable cookies. Add the code below in your .sailsrc
:
{
...
"hooks": {
"session": false
}
}
Source: http://sailsjs.org/documentation/reference/configuration/sails-config-session#?disabling-sessions
Try this one, It works for me:
Set Cookie
res.cookie('cookieName', "cookieValue", { expires: new Date(Date.now() + 300000), httpOnly: true, signed: true });
Get Cookie
req.signedCookies.cookieName;
Delete Cookie
res.clearCookie('cookieName');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With