Javad Shareef
Javad Shareef

Reputation: 496

Is it possible to see active sessions using php?

I am developing a php application. Is it possible to get active sessions and session values on my server? And is it possible to end up a particular session?

Upvotes: 0

Views: 4771

Answers (2)

ocirocir
ocirocir

Reputation: 4048

Currently in PHP you cannot get the active sessions directly. But, you can create your own session handler ( http://pt2.php.net/manual/en/function.session-set-save-handler.php ) and manage the session files.

Upvotes: 1

macjohn
macjohn

Reputation: 1803

If you want maximum flexibility with sessions you can save all your sessions in a database. Then it is very easy to get number of sessions, content of any session, kill them, etc...

http://shiflett.org/articles/storing-sessions-in-a-database

As a bonus you will increase the security!

Upvotes: 5

Related Questions