Laravel 5 refresh login page after session times out -
i have seen many posts similar question , talk redirecting login page when of course logged in , session times out.
my problem login page using auth:guest
middle-ware.
if on login page... 120mins , session times out , enter credentials , click submit button tokenmismatchexception
error.
i want refresh login page when session has expired such has new csrf token.
thanks, k
add following app/exception/handler
use illuminate\session\tokenmismatchexception;
and render method
if ($e instanceof tokenmismatchexception) { if ( !$request->ajax() ) { return redirect()->back()->withinput(); } }
Comments
Post a Comment