Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by rgbrgb for Flask message flashing fails across redirects

I got it! The trick is to set server name to something with dots.

So 'localhost' became 'app.local' and app.local should be added to /etc/hosts, pointing to the same address as localhost.

From the docs:

Please keep in mind that not only Flask has the problem of not knowing what subdomains are, your web browser does as well. Most modern web browsers will not allow cross-subdomain cookies to be set on a server name without dots in it. So if your server name is 'localhost' you will not be able to set a cookie for 'localhost' and every subdomain of it. Please chose a different server name in that case, like 'myapplication.local' and add this name + the subdomains you want to use into your host config or setup a local bind.


Viewing all articles
Browse latest Browse all 3

Trending Articles