local development with cookies using domain name

I have a staging server with the domain name staging.example.com that issues CloudFront cookies for protected content with set_cookie, but I want to develop the app locally on localhost.

The cookies are issued for the domain stream.example.com, so they are both subdomains of the main domain.

The problem is the cookies are not sent when using localhost. I’ve tried changing /etc/hosts so that staging server routes to and added the domain to ALLOWED_HOSTS, but Django now refuses to allow logins.

Is there a way I can get these cookies to work locally?