我正在使用Laravel 5.2,新的Sentinel 2.0安裝,註冊工作正常,但嘗試登錄會返回用戶,但不設置任何cookie或會話或任何其他信息。 。Sentinel :: authenticate()不起作用
UPDATE1
這時我發現,沒有Cookie /會話保存任何。我無法弄清楚爲什麼cookie沒有被推送。
AuthController.php
namespace App\Modules\Auth\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class AuthController extends Controller {
public function getLogin() {
return view("Auth::login");
}
public function postLogin(Request $request) {
$credentials = [
'email' => $request->input('login_email'),
'password' => $request->input('login_password'),
];
if (\Sentinel::authenticate($credentials)) {
return redirect('core/dashboard');
}
}
}
\Sentinel::check();
的var_dump()之前重定向
object(Cartalyst\Sentinel\Users\EloquentUser)#188 (27) {
["table":protected]=>
string(5) "users"
["fillable":protected]=>
array(5) {
[0]=>
string(5) "email"
[1]=>
string(8) "password"
[2]=>
string(9) "last_name"
[3]=>
string(10) "first_name"
[4]=>
string(11) "permissions"
}
["persistableKey":protected]=>
string(7) "user_id"
["persistableRelationship":protected]=>
string(12) "persistences"
["loginNames":protected]=>
array(1) {
[0]=>
string(5) "email"
}
["connection":protected]=>
NULL
["primaryKey":protected]=>
string(2) "id"
["perPage":protected]=>
int(15)
["incrementing"]=>
bool(true)
["timestamps"]=>
bool(true)
["attributes":protected]=>
array(9) {
["id"]=>
int(1)
["email"]=>
string(25) "[email protected]"
["password"]=>
string(60) "$2y$10$wXHwd6ubbHWWXU9CBI/7AOdDsHY.f7t8b1Kjem0m1ep7Ud.9M/4i6"
["permissions"]=>
NULL
["last_login"]=>
object(Carbon\Carbon)#192 (3) {
["date"]=>
string(26) "2016-01-06 15:15:42.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
任何想法可以去錯了嗎?
in .env
會話驅動程序設置爲database
,登錄後會話表爲空。沒有cookie被設置。