check user is logged in to opencart or not

左心房为你撑大大i 提交于 2020-07-22 09:30:50

问题


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.


回答1:


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.
}


来源:https://stackoverflow.com/questions/47354618/check-user-is-logged-in-to-opencart-or-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!