gpt4 book ai didi

php - 通过在 L5 中点击浏览器上的后退按钮来防止注销后重新登录?

转载 作者:行者123 更新时间:2023-12-04 00:32:32 26 4
gpt4 key购买 nike

我的问题是当我已经注销时我想做的,如果我点击浏览器上的后退按钮它永远不会返回管理主页。

现在,当我点击后退按钮时,它会显示管理 secret 页面,但是当我刷新页面时,它会返回到登录页面。

我在 Laravel 4.2 上将代码写在 filter.php 中解决了

App::after(function($request, $response)
{
$response->headers->set('Cache-Control','nocache, no-store, max-age=0, must-revalidate');
$response->headers->set('Pragma','no-cache');
$response->headers->set('Expires','Fri, 01 Jan 1990 00:00:00 GMT');
});

但是现在如何通过在 L5 中点击浏览器上的后退按钮来防止注销后重新登录?

最佳答案

将此行保留在登录页面的顶部。这将清除缓存并防止返回页面(pabel)

<?php echo
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: text/html');?>

关于php - 通过在 L5 中点击浏览器上的后退按钮来防止注销后重新登录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29740338/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com