Я пытаюсь установить несколько переменных cookie и перенаправить на следующий маршрут.
$inputParams = [];
$inputParams['show_match_skus'] = $this->request->input('show_match_skus');
$inputParams['show_all'] = $this->request->input('show_all');
$inputParams['prevent_dialog'] = $this->request->input('prevent_dialog');
$inputParams = array_map(array($this, 'sanitizeInputParams'), $inputParams);
$filterArr = array_filter($inputParams);
if(count($filterArr) > 0) {
if(array_key_exists('show_match_skus', $filterArr)) {
$cookie_sku_match = Cookie::make('show_match_skus', true);
}
if(array_key_exists('show_all', $filterArr)) {
$cookie_all = Cookie::make('show_all', true);
}
if(array_key_exists('prevent_dialog', $filterArr)) {
$cookie_prevent = Cookie::make('prevent_dialog', true);
}
}
//dd(Cookie::get());
//dd(Cookie::get('show_all'));
return redirect()->route('list');
После создания cookie мне нужно перенаправить на list
route.
Но при проверке в браузере, Я не получаю.
Также Cookie::get()
отображает только XSRF-TOKEN
и laravel_session
.
Но Cookie::get('show_all')
показывает cookie.
Что я делаю не так