Update security.php

This commit is contained in:
Namhyeon Go 2019-10-11 17:00:14 +09:00 committed by GitHub
parent eadb4be415
commit c885d9e08b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -639,5 +639,21 @@ if(!check_function_exists("check_redirect_origin")) {
}
}
// start session (enable $_SESSION)
session_start();
// since 1.6 or above
if(!check_function_exists("start_isolated_session")) {
function start_isolated_session() {
$cwd = get_current_working_dir();
session_save_path($cwd . "/storage/sandbox/sessions");
@ini_set("session.save_path", $cwd . "/storage/sandbox/sessions");
@ini_set("session.gc_probability", 1); // enable gc(gabage collection)
session_start(); // enable $_SESSION
}
}
// since 1.6 or above
if(!check_function_exists("end_isolated_session")) {
function end_isolated_session() {
$_SESSION = array();
session_destroy();
}
}