I'm building an E-Learning system with Magento, and would like to avoid customer to share it's credentials with others. In other words, to avoid them to have multiple sessions with the same account.

The closest solution I've imagine, was saving sessions in DB (instead files), and add some customer_id column on core_session database, extending some core classes.

Is there an easier or better approach for doing that?

3 Answers 3


Take a look at log_visitor and log_visitor_online tables.


The answer from Tim is a bit uncomplete but you need to have a look at these tables begin with log_*. It will permit you to know wether a customer is active on the website at the moment and details about the browser used to access it. Thanks to a link between log_visitor_info and log_customer.

Using that, you can call an observer to check if the user is already active. As far as I know, there is not a default solution.

  • I tried to see that table, but the log_visitor_online doesn't seem to be updated correctly. I've logged in with a customer, and in the table it still shows that the customer is a guest. Apr 22, 2016 at 14:56
  • go to system > configuration > advanced > system. You'll see a tab "log" set to yes instead of "visitors only" or "no". That is what is probably set now. Apr 22, 2016 at 15:11
  • Thank you, but didn't work either. log_visitor_online keeps with no record. Apr 22, 2016 at 16:55
  • there is a refreshing rate under system > configuration> customers > customer configuration but I am on my phone and I am not sure of what it is. Apr 22, 2016 at 18:18

Not only is this hard to accomplish robustly, it will also degrade the experience for the customer. Imagine he's signed in at computer A (work) and forgot to log out, wants to log in at computer B (home) and finds out he still has an active session.

  • I do not think that was the point of the question. Moreover, you can set timeout for the session. Apr 22, 2016 at 14:51
  • It's ok if I can invalidate the other session. I don't intend to avoid the customer login. I just don't want to allow multiple login. Apr 22, 2016 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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