I am new in Laravel.
Now I want to use the middleware
.
So Please help me.
My code is:
$input = Input::except('_token');
if(Auth::attempt($input)){
return redirect()->intended('dashboard');
}else{
return Redirect::to(route('login'))
->with('message','Sorry, Wrong Username and password .');
}
The Auth::attempt
is working perfectly and its redirecting to dashboard as expected.
But when I try to check the Auth::check
function from the controller its returning the else statement.
public function dashboard(){
if(Auth::check()){
return View::make('dashboard');
}else{
return "Not logged in";
}
}
How can I fix the issue ?
Session.php
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 120,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => null,
'secure' => false,
'http_only' => true,