You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
342 B
19 lines
342 B
<?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();
|
|
}
|
|
});
|
|
}
|
|
}
|