1
0
Fork 0
Manager/app/middleware/PreSessionMiddleware.php

23 lines
454 B
PHP
Raw Normal View History

2023-08-29 11:55:12 +00:00
<?php
declare(strict_types=1);
namespace Mcp\Middleware;
class PreSessionMiddleware extends SessionMiddleware
{
public function __construct(string $cookieDomain)
{
parent::__construct($cookieDomain, 0);
}
public function canAccess(): bool
{
parent::handleSession();
return !isset($_SESSION['LOGIN']);
}
public function handleUnauthorized(): void
{
header('Location: index.php');
}
}