Hi Is there any posibility to find out how many php sessions are currently open on my site? My users log in using session, and I want to know how many of them are online
Count the number of files present in sessions directory. It is normally /tmp. You can confirm the session path from php.ini.
You are right. I assumed the site is running on a dedicated server. Then the only solution which I can think of is to use database driven sessions on your site.
Thanks The best way is to change the code to simple log this information (last page, time, etc.) then have another page parse this data for active users over the last x minutes.
thanks guys. I have decided to create a database based script to get the number of users online, I have already make some tests and it seems to do the job
Make sure to make it a memory based table as you it is not crucial data. Memory based will be faster, but any time mysql is restarted it will be cleared. You'll find most software use memory based for their sessions so you would not be alone in doing this.