Answer the question
In order to leave comments, you need to log in
Why can't I set a cookie in laravel?
I created a middleware class - I wanted to check cookies there and set them. I am using this code. Why do you think that when you refresh the page, NULL stubbornly comes out all the time
namespace App\Http\Middleware;
class CustomerSession
{
public function handle($request, \Closure $next)
{
var_dump(\Cookie::get('customer-session-id'));
Cookie::queue('customer-session-id', 'test-value', 60 * 24 * 360);
return $next($request);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question