Limit Active Login Sessions – Questions
-
Hi,
Thank you again for a great plugin!
I have three questions regarding this new feature, particularly as to how it compares to the free Loggedin plugin that I am currently using:
1) The Loggedin plugin gives multiple ways as to how to handle what happens when a user tries to log in when they’ve already hit their limit. My preferred method that I use for my website is that it automatically terminates an older session if the limit has been reached when the user is trying to log in. This therefore allows the user to log in seamlessly as normal without having to be alerted that anything has happened in the background.
In contrast, with your plugin’s only method, I believe the user a) tries to login, b) sees an error message, c) clicks to clear active sessions and then d) tries to log in again. This is significantly more frustrating for a user.
Is the first method, i.e. automatically terminating the oldest session when a user starts a new session if the limit has been reached, currently possible with the current version of this plugin with a snippet? Or even terminating all older sessions rather than the oldest session? If not, is it something that you could look at in the future by possibly giving different options like the Loggedin plugin?
2) I currently use the following snippet with the Loggedin plugin so that certain roles (admins and editors) can still have unlimited sessions:
function loggedin_roles( $prevent, $user_id ) { // Array of roles to bypass. $allowed_roles = array( 'administrator', 'editor' ); $user = get_user_by( 'id', $user_id ); $roles = ! empty( $user->roles ) ? $user->roles : array(); $bypassed = array_intersect( $roles, $allowed_roles ); return ! empty( $bypassed ); } add_filter( 'loggedin_bypass', 'loggedin_roles', 10, 2 );
Does a similar snippet exist for your plugin that results in the same behaviour?
Finally, and most importantly….
3) My biggest issue with the Loggedin plugin is that it does not clear active logins until the user navigates away from the current page (or refreshes the page). For a membership website, this makes this feature almost pointless for many use cases.
For example, if I post on my social media page that I’ve just uploaded the latest video lesson, an unlimited number of people can still watch that lesson with just one account as clearing the active logins won’t have any effect if everyone is navigating to the same page and planning to log out directly afterwards anyway.
Is it possible to prevent this? I remember another LMS plugin had this feature in their pro version which I used during a trial (I can’t remember which one it was as I tried many at the same time last year.) Another plugin similar to Loggedin instead put up a fullscreen warning on any expired session that was still open, blocking the view of the page and thereby achieving the same goal.
Is it possible to look into either of those possibilities, i.e. immediately blocking a user from viewing their current page as soon as their session is cleared?
Thanks again! ??
- The topic ‘Limit Active Login Sessions – Questions’ is closed to new replies.