1

我在 php 手册页 http://www.php.net/manual/en/session.examples.php中看到了这个示例 该示例将为所有客户端创建一个全局会话。我可以使用此示例为所有客户端创建一些全局应用程序,而不是将其保存到数据库或本地文件。这种方法的优缺点是什么?谢谢你的帮助。

4

3 回答 3

2

它可能有效,但我不推荐它......对于使用代码的其他 rdevelopers 的潜在混淆,如果您在错误范围内更新会话变量的潜在问题,以及使用术语“会话”与会话无关的事情可能会导致整个世界的混乱

于 2010-10-04T07:48:24.477 回答
1

Yes it is possible by sharing the session id between two clients but sessions are only used to store temporary data of a user. So once a session is destroyed there is no way to retrieve that data.

于 2010-10-28T08:15:58.057 回答
0

不,这是不可能的,也不建议这样做。会话绑定到一个客户端,客户端不共享会话。

于 2010-09-21T12:33:47.820 回答