mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-30 01:06:19 +00:00
96d4a3ecf7
Due to historical reasons, the code is in subfolder "1". With SVN removal, we place the code back and remove the annoying "1" folder.
19 lines
342 B
PHP
19 lines
342 B
PHP
<?php
|
|
|
|
class Session {
|
|
public static function init() {
|
|
session_name('UOJSESSID');
|
|
ini_set('session.cookie_path', '/');
|
|
ini_set('session.cookie_domain', UOJContext::cookieDomain());
|
|
|
|
session_start();
|
|
|
|
register_shutdown_function(function() {
|
|
if (empty($_SESSION)) {
|
|
session_unset();
|
|
session_destroy();
|
|
}
|
|
});
|
|
}
|
|
}
|