Hello, When I delete all cookies and reload my website in firefox all http requests are returning 500 internal server error(token mismatch exception). Actually I'm sending correct token!(I'm sure at 100% because when I reload site on chrome it works). Problem is that those http requests aren't sending laravel's cookies - xsrf-token and laravel_session. Why? They are just not generating on page load in firefox..In chrome they generates but it's causing same error because they generate just too late or something because when I reload website it works then.
Huh? I'm consufed what should I do..(try to manually somehow create those cookies in javascript on start?)
Thanks for any help.
Edit: I realized laravel's not creating cookies only when I redirect threw handler.php like so:
public function render($request, Exception $e)
{
if($e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
{
// always redirect to homepage
// some code
return response()->view('design', compact('something'));
}
return parent::render($request, $e);
}
how to update it to return view with cookies? Something like:
return response()->view('design', compact('something'))->withCookie('laravel_session', howShouldIAccessIt?)->withCookie('XSRF-TOKEN', huh?);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community