The readme lists the possible values for the sameSite attribute as lax or strict, but Chrome 84 is throwing me a message that says
A future release of Chrome will only deliver cookies with cross-site requests if they are set with
SameSite=NoneandSecure.
Without js-cookie saying "none" is an option to set sameSite to, is this what I'm expected to use to apply it with the secure option?
Cookies.set( 'cookie_name', 'value', { sameSite: 'None;', Secure: true })
This returns cookie_name=value; path=/; sameSite=None; Secure.
Documentation is outdated (back then there was no “None”). Use “None”.
Thanks for the response, @carhartl.
Usage of the "none" value also requires there to be a "Secure" attribute. Is the solution I provided above the expected way I should accomplish this?
Here's what I would expect:
Cookies.set('name', 'value', { sameSite: 'None', secure: true })
Just to notice don't try to test {sameSite: 'none', secure: true} while developing on localhost because it is not https and your cookie will not get set at all.
Most helpful comment
Just to notice don't try to test
{sameSite: 'none', secure: true}while developing on localhost because it is nothttpsand your cookie will not get set at all.