I am using WordPress and Yii2 on same server for single project.
I am expecting flow as if user login from WordPress he/she should login in Yii too.
So I am using curl which send request from WordPress to Yii along with email and password for login into Yii.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://demo.com/loginsupplierwp");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"username=".$author_obj->user_email."&password=".$password);
$output = curl_exec($ch);
curl_close($ch);
Even I am able to see PHPSESSID
in cookies along with request but user unable to login.
The URL works fine if I use get request and enter it directly into browser.
Is there anything I am missing?