Cookie problem in v3.0



General 1 year ago by schaufelmeister

Hi, I am a bit confused by the documentation. Under "Learning More" there is a Link "Cookie API" and under "System Helpers" is a link "Cookie". I have tried to use Cooikie's like described in "Cookie API":

use Nova\Support\Facades\Cookie;
/*On login method*/
Cookie::queue('user', $hash, Cookie::FIVEYEARS);
/*On logout method*/
Cookie::forget('user');

the Cookie gets created but Cookie::forget('user'); don't destroys it. Then I tried to use Cookie's like described in the system helper section but I don't even know what namespace I have to use... ps: Cookie::make() and Cookie::forever() does not work for me either. I can only create cookies with Cookie::queue()



1 year ago by schaufelmeister

ok

Cookie::forget('user')

is just reurning the Object that has to be queued so

Cookie::queue(Cookie::forget('user'));

is the solution.



1 year ago by LuckyCyborg

Yup, that's idea.


Login to reply.