Thursday, March 9, 2017

Delete cookie not working if cookie is set to all subdomains on same domain

I am creating cookie like that:

Cookie::queue(Cookie::make('cookie_name', 'cookie_value', 60, '/', '.domain.com'));

As i understand, cookie is set to domain globally, i mean, that this cookie will work with subdomains also. For example: example.domain.com

However, i can't delete it, if i am initiating deletion on subdomain.

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

How can i do that?

Thanks for any answers.



via Tauras

Advertisement