myth-auth icon indicating copy to clipboard operation
myth-auth copied to clipboard

Deleting a cookie inside Myth Auth Events::on('logout') not working

Open Eeel-12 opened this issue 2 years ago • 0 comments

Hello, Don't know if it's relevant but just in case i post it here. I'm using Event login to set an additional cookie which work perfectly fine, and want to delete it when the Event logout is triggered, but it wasn't working.

I add to change AuthController.php

	public function logout()
	{
		if ($this->auth->check())
		{
			$this->auth->logout();
		}

		return redirect()->to(site_url('/'));
	}

to

	public function logout()
	{
		if ($this->auth->check())
		{
			$this->auth->logout();
		}

		return redirect()->to(site_url('/'))->withCookies();
	}

Now it works fine.

Eeel-12 avatar Jul 20 '22 19:07 Eeel-12