angelorigo
3 years ago

Reading cakePHp session into Laravel and Authenticating into Laravel

Posted 3 years ago by angelorigo

Hi

I am redirecting from cakePHP 2.5 to Laravel 5.1 app and need to share the authentication maintaining the same user logged in into both cakePHP and Laravel.

The session is stored on Memcached.

How can i read the cakePHP session and authenticate into Laravel ?

I redirect with this hacking at cakePHP Webroot/index.php using the PHP native header function, can i pass aditional needed data using header?:

App::uses('LaravelController','Controller');
$Laravel = new LaravelController();
if( $Laravel->faq() != "" ){
      header("Location: http://www.laravelapp.com/faq");
} else {
        App::uses('Dispatcher', 'Routing');
        $Dispatcher = new Dispatcher();
        $Dispatcher->dispatch(
                new CakeRequest(),
                new CakeResponse()
        );
}

Into laravel {{ dd( Request::session() ) }} just shows the Laravel session and {{ dd( Auth::check() ) }} returns false .

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