igfs/kernel/middlewares/AuthMiddleware.php
2024-10-23 16:16:47 +03:00

19 lines
285 B
PHP

<?php
namespace kernel\middlewares;
use kernel\Middleware;
class AuthMiddleware extends Middleware
{
function handler()
{
if(!isset($_COOKIE['user_id']))
{
header('Location: /admin/login', true, 302);
return false;
}
}
}