Timecard/provide/classes/UserSession.php
2022-05-22 15:22:49 +09:00

36 lines
579 B
PHP

<?php
/***
* Copyright (c) 2022 DevRas
*
*/
class UserSession
{
public function __construct()
{
@session_start();
}
public $SessionName = "devras_timecard";
public function isLogged()
{
if (!isset($_SESSION[$this->SessionName]))
{
return false;
}
return !empty($_SESSION[$this->SessionName]);
}
public function getUsername()
{
return $_SESSION[$this->SessionName];
}
public function setUsername($value)
{
$_SESSION[$this->SessionName] = $value;
}
}