May 17, 2018
0
Level 1
I dont cant to get the cookie
Hi, I am begining with laravel and I have choosen cookies to handle a login, and if a user is logged in, but I ended up making tests and in the /api/login route, I handle the data sended by the user by this way:
//code ommited
$response = response($token);
$response->cookie(Cookie::make('logincookiename', 'value', 60));
return $response;
At the end of the method I create, first a response object with the token, and I set next, the cookie logincookiename to 'value' but I am currently trying to retrieve that cookie in /articles (for testing) but I get nothing:
return response($request->cookie('logincookiename', 'aaa'));
How can I resolve this? :( Please help...
Please or to participate in this conversation.