Game-Jaming/Backend/Controllers/Admin/Admin.php

23 lines
326 B
PHP
Raw Normal View History

<?php
/**
* @return bool
*/
2021-03-12 10:10:14 +00:00
function isAdmin(): bool
{
session_start();
return isset($_SESSION['admin']);
}
2021-03-26 13:03:02 +00:00
/**
* @param string $userName
*/
2021-03-26 10:00:45 +00:00
function makeAdminLogin(string $userName)
{
setcookie("userName", $userName, [
'expires' => 0,
'samesite' => 'Strict',
'path' => '/'
]);
}