amdp3-metaforums/Application/Services/Session.php
2019-11-19 02:18:37 +07:00

24 lines
492 B
PHP

<?php
namespace Application\Services;
class Session {
public function __construct() {
session_start();
}
public function get($path) {
return $_SESSION[$path];
}
public function set($path, $val) {
$_SESSION[$path] = $val;
}
public function unset($path) {
$_SESSION[$path] = null;
}
public function has($path) {
return isset($_SESSION[$path]);
}
public function destroy() {
session_destroy();
}
}