how to get user ids in session table

hello everybody

I have in the main.php-Config file this setting:

'session' => array(

     'class' => 'CDbHttpSession',

     'sessionTableName' => 'yii_session',

     'timeout' => 82800,

     'connectionID' => 'db' 


Yii saves the users, who loggedin in my yii_session table. how its possible to query all users who are loggedin?

thank you for your helps.


you cannot do that not only with Yii but in general. There is no such thing that could iterate through opened sessions as this would be realy big security hole…

you must create some storage (file, db table, etc) and place there every user id that is logged. Unfortunately you will have problems to determine if the user is still logged or just disapear…