Skip to content

Commit

Permalink
Preserve "locale" cookie value on redirect to localized URL
Browse files Browse the repository at this point in the history
  • Loading branch information
okovpashko committed Mar 28, 2020
1 parent 13f418e commit 4aa57e9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function handle($request, Closure $next)
$redirection = app('laravellocalization')->getLocalizedURL($locale);
$redirectResponse = new RedirectResponse($redirection, 302, ['Vary' => 'Accept-Language']);

return $redirectResponse->withCookie(cookie()->forever('locale', $params[0]));
return $redirectResponse->withCookie(cookie()->forever('locale', $locale));
}

return $next($request);
Expand Down

0 comments on commit 4aa57e9

Please sign in to comment.