Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable Back Button when the user has logged out? #43

Open
abhaypithadiya opened this issue Mar 19, 2023 · 0 comments
Open

How to disable Back Button when the user has logged out? #43

abhaypithadiya opened this issue Mar 19, 2023 · 0 comments

Comments

@abhaypithadiya
Copy link

Hey! I am using a custom authentication system. After the user is logged out and when he clicks on the browser back button, He can still see the page. How to avoid this? I am already using a middleware for back button.

Back Button Disable Middleware Code

    public function handle(Request $request, Closure $next)
    {
        $response = $next($request);
        $response->headers->set('Cache-Control', 'nocache, no-store, max-age=0, must-revalidate');
        $response->headers->set('Pragma', 'nocache');
        $response->headers->set('Expires', 'Sat, 01 Jan 2000 00:00:00 GMT');

        return $response;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant