Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get All The Active User Id List #10404

Closed
MrAwanishKumar opened this issue Dec 16, 2015 · 2 comments
Closed

Get All The Active User Id List #10404

MrAwanishKumar opened this issue Dec 16, 2015 · 2 comments

Comments

@MrAwanishKumar
Copy link

Hi,

There is a requirement to show the all logged in user name to admin. For example -
Suppose we have 100 users and at a time 50 users are logged in, so how can I get the list of these 50 users.

I tried searching on github and yii2 documentation, but did not find. Please share link if exists.

Thanks

@SilverFire
Copy link
Member

An option will be to use custom DbSession with additional user_id field. Than it's easy to count active users with SQL query and condition like user_id IS NOT NULL and expire - $maxLifetime > NOW() - '30 minutes' (pseudocode)

Please notice that this Yii2 is for bug reports. We are happy to help you on support forum or in gitter room https://gitter.im/yiisoft/yii2. It's always better to text there, unless you are sure it is a Yii2 core problem.

@samdark
Copy link
Member

samdark commented Dec 16, 2015

Linked issue is a cookbook draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants