ashvin
1 year ago

How to autologin Wordpress from Laravel, when user log into Laravel application

Posted 1 year ago by ashvin

Hi All, I am trying to integrate the wordpress in my laravel application. I put the "wordpress" folder inside the public folder. I need to try automatically login to wordpress when user sign in inside the laravel. I have found some solution that suggest give the path of /wp-load.php and create the session by following code.

  $userid = $user->ID;
  wp_set_auth_cookie($userid);
  do_action('wp_login',$userid);

I have done the same type of integration in the codeigniter, but i am unable to load the wp-load.php.

Example site url: Laravel installtion : http://dev.local/ Wordpress: http://dev.local/wordpress

I used the corcel package: https://github.com/corcel/corcel/tree/2.5 for get the data from wordpress to laravel. I am new to laravel, please suggest me for this. Thanks

Please sign in or create an account to participate in this conversation.