0

I have two development servers written with Python/Django - one API server(it's not solely an API server; it has UI and etc.), and another one is a demo app used to serve data by communicating to the API server. I invoke the demo app with iframe in the API server. After successfully getting response from the demo app, the original user session of the API server is lost(supposed to have two sessions -- one from the user of the API server, one from communication between the demo app and the API server).

Any idea what happened?

4

1 回答 1

1

如果您在同一台服务器上运行两者,则会话 cookie 可能会被覆盖,因为它们都需要sessionidcookie。如果 sessionid 不存在,则会生成一个新的,因此当您访问外部应用程序时,您会获得一个 sessionid cookie,并将其传递给 iframe 应用程序,该应用程序无法识别它并生成一个新的。尝试为每个应用程序赋予它自己的独特性SESSION_COOKIE_NAME

于 2013-05-02T16:47:38.710 回答