Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hesto's avatar
Level 5

[5.3] Multi Auth configuration problem: guards use same session

Hi, I created package for easy setup multi auth https://github.com/Hesto/multi-auth . It just configure multi auth in Laravel 5 way. Almost everything work great but when we log into 2 different guards and then we logout from one of them, the second guard logging out too. Do you know how to fix it? Here is github issue: https://github.com/Hesto/multi-auth/issues/11

0 likes
3 replies
d3xt3r's avatar

Yes, it would as it shares the same cookie and hence session. Guards are not meant for different sessions, but different authentication logic. The hack wont be trivial and it would require manipulating cookies and session.

Hesto's avatar
Level 5

@d3xt3r I think there must be a way to logging out only one guard. Look at this method from AuthenticatesUsers trait:

public function logout(Request $request)
 {
        $this->guard()->logout();

        $request->session()->flush();

        $request->session()->regenerate();

        return redirect('/');
 }

I think the idea was to logout only one guard...

kuns25's avatar

@HESTO - @hesto Hii I've Installed the package i can't find where admin/home route is defined , or from which controller its returning me the view admin.home blade file , can you help me .

Please or to participate in this conversation.