I'm using express and using ngrok to test my server so I have a URL like a846d0979b95.ngrok.io
. In express I'm trying to set a cookie so that the domain property is ".ngrok.io" and not "a846d0979b95.ngrok.io" to set the cookie on the domain and not on the subdomain.
response.cookie('test-cookie', '1234', {
domain: '.ngrok.io'
})
Although on chrome dev tools the cookie is not accepted. Chrome gives the error This Set-Cookie was blocked because its Domain attribute is invalid with regards to the current host URL
Note:
I can set the cookies for a846d0979b95.ngrok.io
with the default domain "a846d0979b95.ngrok.io" with no problem