Find Number of Open Sessions

前端 未结 4 1392
不思量自难忘°
不思量自难忘° 2020-11-27 22:08

I\'m looking for an easy (no database) method of listing how many users are active on a website. The easiest way I can come up with is by counting the number of open sessio

4条回答
  •  日久生厌
    2020-11-27 22:53

    Easy does not mean no database in this case. Also relying on session to see how many users are active is not reliable.

    If you wanted to go that route, you could do a cronjob that is run by a safe process every few minutes and saves that count into a file or db, which PHP reads.

    But i recommend going the database route.

提交回复
热议问题