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

Is there a way to distinguish user switching from regular logins? #69

Closed
therealgilles opened this issue Apr 30, 2021 · 1 comment
Closed

Comments

@therealgilles
Copy link

I would like to keep tracks of regular user logins and filter out user switching logins. Is there a way to do that? Thanks for any advice :)

@johnbillion
Copy link
Owner

Yep this is possible. If you use the authenticate filter or the wp_login action then those only fire when a user actually logs in, not when a user switches.

If you use the set_auth_cookie action then that will also fire when a user switches. In that case I don't believe you can determine at that point whether the user is logging in or switching because the corresponding $_COOKIE values won't be updated at that point.

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

2 participants