0

我的服务器上有 5 个 django 网站。问题是我不能同时登录每个网站,当我登录网站 A 并单击另一个网站 B 时:我在 A 上失去连接。我只能在一个网站上登录时间。

4 个站点使用 sqlite,1 个使用 postgresql,每个站点都有自己的文件夹。我使用 django 1.4 和 DB session storage 和 mod wsgi。

你知道我怎样才能使用户连接持久,以便我可以同时登录所有网站吗?我不知道如何解决这个问题,可能是数据库的问题,或者我的wsgi配置不好。

谢谢。

4

2 回答 2

0

Because you are using the same domain for all the websites you must set the SESSION_COOKIE_PATH in each Django website to point to the top-level path that the website is served from. You can find more details here

It's also advisable to set a different SESSION_COOKIE_NAME for each website.

于 2014-06-10T17:31:31.597 回答
0

最后我只是改变了 SESSION_COOKIE_NAME 并且它有效。谢谢大家。

于 2014-06-11T12:49:57.380 回答