This is due to how browsers and cookies work. Since you cannot set cookies on something like .com, you also cannot set it as .localhost.
You can find out more here: https://code.djangoproject.com/ticket/10560 . There seems to be no real solution in Django for this. I would like them to warn us, and not just break.
I have no good solution. For testing, you can configure the hosts file to use something like test.com instead of localhost to point to your server.
source share