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…