Disable session cookies

Hello,
Is there a way to stop the session cookies on certain requests? And the ‘XSRF-TOKEN’ cookie.

There are a few requests i have and i want to have no ‘Set-Cookie’ headers and no ‘Access-Control-Allow-Credentials’

1 Like

You can remove them in the response from your controller or route.

E.g:

response.clearCookie('XSRF-TOKEN')

See: https://adonisjs.com/docs/4.1/response#_cookies

1 Like