Session Count

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Session Count

Post by Shendemiar »

Is there a easy way to know how many active sessions there are, when servers sessions folder is not accesseble?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

If the servers session.save_path isn't accessible then how are you setting sessions?
If you can store a session (using files) on the server then you can read the session folder..
echo count(glob(ini_get('session.save_path').'/*')); would tell you how many files are in that folder, but course, you then need to check which of those are session files if it's not a dedicated sessions folder and also which sessions are 'yours' if you're on a shared host (they might lump them all together in one folder ... which would be Bad[TM]).
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

Ok i take it then that the folder is accessible, and i suppose that the host has it per user settings, so it's not common to everybody, but i will have to check it.

And as it is accessible, i take it that by examining the session files i can get a list of users & guests online.
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

At my host's sessionfolder there are lots of files, and i have only access to those that are my sessions.

With what can i check if i have access to a file?
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

fileperms
Post Reply