koblog/bl-kernel/helpers/redirect.class.php
Jyoti S 134d8faa85
Logout redirection call must reach the server
On Firefox 130 the logout (301 redirection to admin page) is getting cached and hence the logout action does not take place. Adding Cache-control to specify the browser to not-cache this is required for logout to work properly.
2024-10-02 07:50:04 +05:30

30 lines
539 B
PHP

<?php defined('BLUDIT') or die('Bludit CMS.');
class Redirect {
public static function url($url, $httpCode=301)
{
if (!headers_sent()) {
header("Location:".$url, TRUE, $httpCode);
exit(0);
}
exit('<meta http-equiv="refresh" content="0; url='.$url.'"/>');
}
public static function page($page)
{
self::url(HTML_PATH_ADMIN_ROOT.$page);
}
public static function home()
{
self::url(HTML_PATH_ROOT);
}
public static function admin()
{
header('Cache-Control: no-store');
self::url(HTML_PATH_ADMIN_ROOT);
}
}