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

vandyczech's avatar

Laravel 7 logout after page refresh

Laravel authentication works, but when I logged in and then refresh the page, auth redirect me back to login. The user was logout. why?

0 likes
3 replies
nfms's avatar

How are you refreshing the page? A browser button, ctrl + R, ctrl + F5. I would think it has something to do with browser cookies being deleted for you laravel application. If those cookies are deleted, a user would have to re-authenticate.

neil-cartwright's avatar

I had the same issue. It was caused by an href to {{ Auth::logout(); }}

Please or to participate in this conversation.