|
Posted by Marek Kilimajer on 05/13/05 12:12
Bogdan Stancescu wrote:
> Hello all,
>
> I guess this comes up once in a while, does anybody know how I can find
> the current PHP sessions' IDs? I don't mind if some have passed away,
> and the PHP gc hasn't run yet, because I'm doing a garbage collection of
> my own, for data identified by session ID -- it doesn't really matter if
> I keep a few obsolete files for a while, it only matters that I delete
> them at some point in the future.
>
> I know I could read the session files themselves, but I'd very much
> rather use a "proper" way to retrieve the active sessions, which would
> work with alternate methods of storing session data, if there is any
> such proper way to do this.
>
> I read the PHP documentation regarding sessions, and I checked out
> Google, with no luck. If you guys don't have a solution, it means that
> there is none -- in other words, you're my last hope, help! :-)
Depends on where and how you store your session data. Default file
storage simply reads all files in session.save_path (opendir() and
readdir()), check if they match the pattern /sess_[0-9a-f]{32}/ and the
modification time.
Navigation:
[Reply to this message]
|