Laravel 5.1.35 身份验证在服务器上部署后不起作用。在本地环境中,它工作正常。
默认成功登录重定向到“/home”,并且在 /home 路由处理程序 Auth::check() 中返回 false。
Route::get( '/home', function () {
var_dump(Auth::user());
} );
上面的代码打印 bool(false);
路线代码:
Route::get('/logout', 'Auth\AuthController@getLogout');
Route::get('/login', 'Auth\AuthController@getLogin');
Route::get( '/home', function () {
var_dump(Auth::user());
} );
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('/login/{param}', 'Auth\AuthController@getLogin');
Route::get('/register', 'Auth\AuthController@getRegister');
Route::get('/signup', 'Auth\AuthController@getLogin');
Route::post('/auth/stepOne', 'Auth\AuthController@stepOne');
Route::post('/auth/stepTwo', 'Auth\AuthController@stepTwo');
Route::post('/auth/stepTwoBrand', 'Auth\AuthController@stepTwoBrand');
Route::post('/auth/register', 'Auth\AuthController@postRegister');