Why does the session cookie work when serving from a domain but not when using an IP?

后端 未结 3 1488
野趣味
野趣味 2020-11-27 21:22

I have a Flask application with sessions that works well on my local development machine. However, when I try to deploy it on an Amazon server, sessions do not seem to work.

3条回答
  •  无人及你
    2020-11-27 21:51

    It is possible to create session in the Chrome browser using IP.

    My config file has these configurations:

        SERVER_NAME = '192.168.0.6:5000'
        SESSION_COOKIE_DOMAIN = '192.168.0.6:5000'
    

    It allowed me to use a local virtual machine and the cookie worked perfectly on Chrome, without the need for a local FQDN.

提交回复
热议问题