CodeIgniter Forums
CSRF Message - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CSRF Message (/showthread.php?tid=45509)



CSRF Message - El Forum - 09-24-2011

[eluser]nuclearmaker[/eluser]
its really weird to show CSRF message to non geek/old people/normal user right?
""
so any idea?

instead

Code:
public function csrf_show_error()
{
  show_error('The action you have requested is not allowed.');
}

what if we do something like this



Code:
public function csrf_show_error()
{
  $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
  
  header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
        header("Location: $url");
        exit();
}
}