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

ericahernandez573's avatar

Laravel still have the session after logout

Hello,

After I logout of my laravel application, in the browser I press the button to backward (go back) and then I see the dashboard.

My client wants to eliminate this "session" that laravel mantein if I go back, (btw; when In that dashboard when I click other URL the middleware redirect me to the login view)

can you help me?

0 likes
6 replies
jlrdw's avatar

At logout, redirect to a certain page.

jlrdw's avatar

I just tested one of my sites, if logged out all I get is the login page. So try the redirect to a page you create for after a logout.

ericahernandez573's avatar

@jlrdw I already redirect to the login page, but when I press the backward buttton laravel send me back to the view of the dashboard, like a view session

jlrdw's avatar

No at logout, redirect to a custom page. Then if you hit back, you should go to logon page. Try that, it works for me.

1 like
bashy's avatar

It will cache the page but it won't be new data and they won't be able to post anything.

You'll find that pressing back twice or selecting a page 2 or 3 steps back will still work.

Please or to participate in this conversation.