24 lines
333 B
PHP
24 lines
333 B
PHP
<?php
|
|
/**
|
|
* @return bool
|
|
*/
|
|
function isAdmin(): bool
|
|
{
|
|
session_start();
|
|
return isset($_SESSION['admin']);
|
|
}
|
|
|
|
/**
|
|
* @param string $userName
|
|
*/
|
|
function makeAdminLogin(string $userName)
|
|
{
|
|
setcookie("userName", $userName, [
|
|
'expires' => 0,
|
|
'samesite' => 'Strict',
|
|
'path' => '/'
|
|
]);
|
|
}
|
|
//test
|
|
|