简体   繁体   English

使用SESSION创建没有数据库的在线用户列表?

[英]Creating list of Online users using SESSION without database?

I want to maintain a list of online users for my website WITHOUT database solution (so as to reduce the load). 我想维护我的网站的在线用户列表,而没有数据库解决方案(以减少负载)。

Is it possible to achieve this with sessions? 可以通过会话来实现吗?

I think you should use the memcache for that. 我认为您应该为此使用内存缓存。 sessions and cookies both have the size limits which obviously is not the right choice 会话和Cookie都有大小限制,这显然不是正确的选择

Maybe you can modify this class a little to also include the username: 也许您可以对此类进行一些修改以包含用户名:

PHP Reports the number of users that are currently online PHP报告当前在线的用户数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM