Auth session expires quickly I'm using the default Laravel 5 auth controllers to authenticate users. After a user logs in, the session expires quickly in few seconds and redirects back to the auth/login page.
Any idea how to fix it?
I tries changing the expire value in config/auth.php but no luck.
Whats your environment? Homestead? Valet? custom?
Can a user actually log in? or does it immediately redirect when you click login
Check the session lifetime in config/session.php
check that a session file is being created in the storage/framework/sessions folder
Thanks for helping everyone.
It was a missing break statement in my Exceptions/Handler.php file.
The code that was causing the issue:
public function render($request, Exception $e)
{
//return parent::render($request, $e);
//return view('errors.custom');
if ( ! config('app.debug') && ! $this->isHttpException($e)) {
return response()->view('errors.custom');
}
if ($this->isHttpException($e)) {
$statusCode = $e->getStatusCode();
switch ($statusCode) {
case '404':
return response()->view('errors.404');
break; // This was missing
}
}
return parent::render($request, $e);
}
Fixed it by adding the break statement.
Thanks all
For anyone else, the solution mentioned above by the author couldn't have been the real issue.
The break after the return would never be hit. Must have been something else.
@coreysan13 you win today's prize for pointless comment on ancient post.
Please sign in or create an account to participate in this conversation.