1

I am new to opencart. I have installed opencart on my domain

http://example.org/ocart

and a php application at url

http://example.com/testapp

testapp is a basic php application in which I want to check if any user is logged in to opencart or not. Is it possible to check in php app that any user is logged in to opencart and if it is logged in then can we get the email id of logged in user.

Both ocart and testapp are using the same database.

Rohitashv Singhal
  • 4,517
  • 13
  • 57
  • 105
  • I don't know opencart but most applications would set a session variable to indicate a login session is active. If you're trying to query that from another session you might have difficult. Really it's none of your business if another user is logged in. If the app writes some info to the database about who has logged in and when, you could use that. It won't be real-time info, but not sure why you'd need that anyway? – ADyson Nov 17 '17 at 16:34

1 Answers1

2

You can check your other question you will get your answer

access session data of opencart through php file

After doing above steps you can access in other http://example.com/testapp

Just Access with this code

session_start();
if(!empty($_SESSION['opencart']['customer_id'])){
      // User Loged in.
}
Prashant
  • 347
  • 1
  • 2
  • 12