I'm using Flask and when I try to use localhost
as the cookie domain, werkzeug says:
ValueError: Setting 'domain' for a cookie on a server running localy (ex: localhost) is not supportted by complying browsers. You should have something like: '127.0.0.1 localhost dev.localhost' on your hosts file and then point your server to run on 'dev.localhost' and also set 'domain' for 'dev.localhost'
This kind of sucks that each developer has to set a domain in hosts
file to get the project working. I can't understand why werkzeug is preventing this!
The questions are:
- Why werkzeug is doing this?
- What would happen if it was possible to use
localhost
as cookie domain? - How can i ignore this error?
/etc/hosts
to 127.0.0.1 for use in development. – Palikar