How to check whether user logged in wordpress site from Yii?

In a my current project, I want to integrate a module done in Yii with a wordpress site.
The user will login through the wordpress site and moved to the Yii section. I want to check from Yii, whether the user is logged in. Yii will be installed with in the root directory of wordpress and both the sites will hosted under same domain. like

http:://www.main-wp-site.com
http:://yiimodule.main-wp-site.com

Related posts

Leave a Reply

2 comments

  1. Got the solution!!
    All I have to do is include the wp-load.php file in the index.php of Yii and after that, I will be able to use all the wordpress functions, including is_user_logged_in()

  2. You can checkout the WordPress Function reference here . The function you’re looking for is is_user_logged_in() which returns true or false if the current user has a valid WordPress login.