CodeIgniter back button after logout

后端 未结 6 1141
攒了一身酷
攒了一身酷 2020-12-04 02:02

I\'m trying to stop/disable the back button functionality of the browser when a user logs out of my CodeIgniter (PHP) app. But, I think the browser is caching the page so it

6条回答
  •  眼角桃花
    2020-12-04 02:50

    Add this to prevent caching of the previous page:

    header("cache-Control: no-store, no-cache, must-revalidate");
    header("cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    

提交回复
热议问题