Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
除非它必须专门与应用程序有关,否则为什么要在数据库中跟踪会话?我的意思是,大多数会话数据都与具有会员资格的用户有关,因此如果用户已登录,您可以通过他们的会员 ID 轻松跟踪他们。那么为什么要将会话数据保存在数据库中呢?
不是每个人都只使用一台服务器运行,并且基于文件的会话很难在多台服务器之间可靠地共享。将会话放入数据库可以解决大部分共享问题。