Session cookie is not set in browser Session cookie is not set in browser heroku heroku

Session cookie is not set in browser


This may not be a CORS issue, it looks like a third-party cookie problem.

Behaviour could be different across browsers so I recommend testing several ones. Firefox (as of version 77) seems to be less restrictive. In Chrome (as of version 83) there is an indicator on the far right of the URL bar when a third party cookie has been blocked. You can confirm whether third party cookies is the cause of the problem by creating an exception for the current website.

Assuming your current setup is as follows:

frontend.combackend.herokuapp.com

Using a custom domain for your backend that is a subdomain of your frontend would solve your problem:

frontend.comapi.frontend.com 

The following setup wouldn't work because herokuapp.com is included in the Mozilla Foundation’s Public Suffix List:

frontend.herokuapp.combackend.herokuapp.com

More details on Heroku.