Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get list of all PHP session_id

Is't possible to get list of all session_id in PHP SESSIONS?

Note: I need maintained some file in the server. One file equal one session. And I need to determine behaviour of old files if SESSION expire.


Thank you all for any advice.

like image 681
LukasSvihel Avatar asked May 13 '11 11:05

LukasSvihel


1 Answers

As others have answered, sessions are stored in the path defined by session.save_path in php.ini and you can iterate this directory to retrieve a list of every session.

An alternative approach would be to change the session storage and move it to a database using session_set_save_handler(). You could store all your sessions in a database and do with it whatever you wish.

like image 134
Aron Rotteveel Avatar answered Oct 04 '22 06:10

Aron Rotteveel