From c885d9e08b4bbf6c5c3e16fc48bedeabf92390ac Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 11 Oct 2019 17:00:14 +0900 Subject: [PATCH] Update security.php --- system/security.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/system/security.php b/system/security.php index 5b28edb..a6a1502 100644 --- a/system/security.php +++ b/system/security.php @@ -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(); + } +}