+ diff --git a/config/member.php b/config/member.php index 296737e..bbc1e30 100644 --- a/config/member.php +++ b/config/member.php @@ -79,4 +79,32 @@ class Member return false; } } + public function logout() + { + if (session_status() === PHP_SESSION_NONE) { + session_start(); + } + + // 세션 변수 비우기 + $_SESSION = []; + + // 세션 쿠키 제거 + if (ini_get('session.use_cookies')) { + $params = session_get_cookie_params(); + setcookie( + session_name(), + '', + time() - 42000, + $params['path'], + $params['domain'], + $params['secure'], + $params['httponly'] + ); + } + + session_destroy(); + + header('Location: ../index.php'); + exit; + } } diff --git a/header.php b/header.php index a6e3070..6def244 100644 --- a/header.php +++ b/header.php @@ -1,3 +1,13 @@ + + + @@ -11,9 +21,9 @@ integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"> ' .PHP_EOL; + if (isset($js_array)) { + foreach ($js_array as $var) { + echo '' . PHP_EOL; } } ?> @@ -30,20 +40,47 @@ Simple header
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..5ff4b01 --- /dev/null +++ b/index.php @@ -0,0 +1,25 @@ + +
+