1
1
mirror of https://github.com/renbaoshuo/S2OJ.git synced 2025-01-30 20:20:00 +00:00

19 lines
339 B
PHP
Raw Normal View History

2016-07-19 00:39:37 +08: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 10:26:21 +08:00
2016-07-19 00:39:37 +08:00
session_start();
2022-11-06 10:26:21 +08:00
register_shutdown_function(function () {
2016-07-19 00:39:37 +08:00
if (empty($_SESSION)) {
session_unset();
session_destroy();
}
});
}
}