mercredi 31 janvier 2018

Laravel external app login session does not persist

Hi I'm trying to do a login function in a external app, its works but the session does not persists when refresh.

function laravelLogin($id)
{
    require $_SERVER['DOCUMENT_ROOT'].'../laravel/vendor/autoload.php';
    $app = require_once $_SERVER['DOCUMENT_ROOT'].'../laravel/bootstrap/app.php';

    $app->make(Illuminate\Contracts\Http\Kernel::class)
        ->handle(Illuminate\Http\Request::capture());

    $user = $app->make('App\Models\User')
                    ->where('id',$id)
                    ->first();

    $app->Auth::login($user);

}

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire