S2OJ/web/app/models/Session.php

19 lines
339 B
PHP
Raw Normal View History

2016-07-18 16:39:37 +00:00
<?php
class Session {
public static function init() {
session_name('UOJSESSID');
ini_set('session.cookie_path', '/');
ini_set('session.cookie_domain', UOJContext::cookieDomain());
2022-11-06 02:26:21 +00:00
2016-07-18 16:39:37 +00:00
session_start();
2022-11-06 02:26:21 +00:00
register_shutdown_function(function () {
2016-07-18 16:39:37 +00:00
if (empty($_SESSION)) {
session_unset();
session_destroy();
}
});
}
}