Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

how can i make sure a user can only be logged in on one computer at a time? I want to make a wordpress site that could potentially have paid accounts for content in the future. Is there anything built into wordpress that prevents a user from being logged in more than once?

share|improve this question
    
do you mean that the user can't use multiple browsers? multiple windows/tabs of the same browser? –  MZAweb May 11 '11 at 0:45
    
hmmm. Ya know I'm not sure. For the moment I was just thinking multiple computers. I don't want multiple people to be able to use the same account at the same time. –  Ghost9 May 11 '11 at 1:28
add comment

4 Answers

As a follow up to @Daniel Dvorkin Answer: I guess you could "simply" hook two functions. One that is fired on login and another one triggered on logout. In both cases you could add some user meta data: logged in/out. If someone is checked in and checks in another time, you will already know in your login action.

share|improve this answer
add comment

You would be shocked and amazed at how difficult this is to do properly.

http://wordpress.org/support/topic/prevent-multiple-login-using-a-single-id?replies=3

share|improve this answer
add comment

Some of the paid subscription plugins offer this. One that I know of off hand and had good experience with is

Your Members with additional addon

share|improve this answer
add comment

A simple way could be hooking into the login process and check if the user is already logged.

There is a 'wp_authenticate' action that runs just before loggin in an user.

share|improve this answer
    
any chance you could give me an example? –  Ghost9 May 11 '11 at 2:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.