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

towhid's avatar

when i click Browser back button after logout show previous session information . how to stop this thing ?

thank you

0 likes
6 replies
bashy's avatar

It's just browser cache. It's not actually live data. There's some things you can do but Chrome and other browsers make it hard to stop caching it.

towhid's avatar

@avaneeshsingh this is code for form process destroy method , but i am using general way like

controller code

public function destroy()
    {
        auth()->logout();

        return redirect('/posts'); //->home()
    }

And my front end code

 <li><a href="/logout">Logout</a></li>

Route code

Route::get('logout','sessionController@destroy');
towhid's avatar

@bashy Thank you fro this information but how to control it ? any suggestion please . :/

bashy's avatar
bashy
Best Answer
Level 65

@towhid Search on your favourite search engine for stop browser caching after logout. There's so many topics on it.

1 like

Please or to participate in this conversation.