How to limit active logins from a single account?

Next month, I will be rolling out pricing plans to readers on my site. In order to read the content on my website, readers will need to subscribe to a payment plan.

However, I have major concerns that readers will sign up for an account, pay for a subscription and then share that account login information with their friends and family.

How do I limit the number of active logins that an account has on my website? This is an extremely important aspect of my site and the revenue implications are potentially massive.

Thanks.

I remember someone has already asked this question. Try to search the forum.

Hi J.D.

Yes, I saw a separate forum post (which you replied to), but it was simply users asking for greater clarity or if there was any follow-up. No solution was identified. Are you aware of a solution?

@garrettzatlin there was a thread with some solutions, I don’t remember and I don’t have time to search.
But maybe you can do something like that.
You subscribe a logged-in user to a realTime channel that is based on userId.
On new login you first send a message to this cannel to logout and then you subscribe the current instance to this channel. This way if a user logs in it’ll log him/her out of all other sessions.

@jonatandor35 Thanks J.D. this is good insight. I’ll continue to research.

I have the same problem, any luck?
I thought about something like this.
Create a database collection to store user login information.

  1. Write a function to check if a user is already logged in.

  2. Modify the login process to include a check for concurrent logins.

  3. Implement a function to clear the user login information upon logout