DEV Community

Belhassen Chelbi
Belhassen Chelbi

Posted on

Does a same-origin cookie work in a subdomain

Let's say the front-end is hosted in Netlify with and the backend in a VPS with
For example: Django session authentication, can I get this to work like this?

Top comments (1)

skaterdad profile image

Yes, that is possible. A period in front of the domain on that cookie headers is what tells browsers to send it on subdomains.

I'm not familiar with the way Django handles it, but hopefully this helps.