Search code examples
cookiessamesitechrome-devtools-protocol

Chrome DevTools Protocol: `Network.setCookie({ sameSite: 'None' })` fails, why?


I'm having an issue where the Chrome DevTools Protocol returns { success: false } when sending a Network.setCookie request with sameSite set to "None".

What could the issue be? "Lax" and "Strict" appear to work fine.


Solution

  • sameSite can only be set to "None" on a secure cookie. Try passing { sameSite: "None", secure: true }.

    More info on SameSite=None: https://web.dev/samesite-cookies-explained/#changes-to-the-default-behavior-without-samesite