0

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

0

Take a look at log_visitor and log_visitor_online tables.

0
0

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.

4
  • 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. Commented 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. Commented Apr 22, 2016 at 15:11
  • Thank you, but didn't work either. log_visitor_online keeps with no record. Commented 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. Commented Apr 22, 2016 at 18:18
-2

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.

2
  • I do not think that was the point of the question. Moreover, you can set timeout for the session. Commented 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. Commented Apr 22, 2016 at 14:55

Your Answer

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

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