Skip Navigation

[Resolved] Create a user active session control

This thread is resolved. Here is a description of the problem and solution.

Problem:
The issue here is that the user wanted to limit the number of active sessions that a logged in user can have.

Solution:

Unfortunately we are not able to assist with this since it is not a part of what our plugins can do and would require custom code to achieve.

However I was doing some searching and was able to find this plugin here.
https://wordpress.org/plugins/loggedin/

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by rafaelE-3 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#687939

I need to control the number of active sessions opened by the same user. (On different browsers)

I have created a post type called "sessions" and two fields on this called "usuario" and "active_session".

What I want is to create a new "session" entry, each time a user logs in to the website like this:
-> usuario: 6 active_sessions: 1

And then, delete the last entry, each time the users with the user_id=6 logs out.

Then, I will add all the entries with the same user id with a view and compare that value with another stored on a custom field. If it is greater than that value I will redirect the user to a page telling him to close one of the other sessions to continue...

I was expecting to use the wp_login and wp_logout hook to to this, bu t I don't know how to create the code to make it works.
Can you help me to do something like this?

Thanks in advance!

#688187

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Rafael,

Thank you for contacting our support forum.

Unfortunately we are not able to assist with this since it is not a part of what our plugins can do and would require custom code to achieve.

However I was doing some searching and was able to find this plugin here.
https://wordpress.org/plugins/loggedin/

It should be able to assist you with doing this.

Thanks,
Shane

#690618

I tried this plugin before asking for support, but it doesn't worked for me.
I will find other solution.
Thanks!