How to find if a specific user is logged in?

There are any way to check if a user is logged in?

For example some forums have a list of logged in users, of in many cases you can see close to username a green flag if the users is online or a red one if the users is not logged in.

In my website I use yii2-user from dektrium, but I’m not finding any way to check if a users is logged in or not

Hi!

As far was I know there is no "easy" pre-build solution for this.

Look at this thread:

http://www.yiiframework.com/forum/index.php/topic/63973-check-if-some-user-is-active/page__p__281360__hl__%2Buser+%2Blogged+%2Bin__fromsearch__1#entry281360

I think you may store the sessions in a db and check for the active ones