diff --git a/i_entrance/j_logout.php b/i_entrance/j_logout.php index 8358460e..053b7b52 100644 --- a/i_entrance/j_logout.php +++ b/i_entrance/j_logout.php @@ -3,7 +3,13 @@ namespace sammo; require_once('_common.php'); -$session = Session::requireLogin(); +$session = Session::Instance(); +if(!$session->isLoggedIn()){ + //로그인 안했다니까... + Json::die([ + 'result'=>true + ]); +} @@ -17,7 +23,6 @@ RootDB::db()->insert('member_log',[ ]) ]); -$session->access_token = null; $session->logout(); $session->setReadOnly(); setcookie("hello", "", time()-3600); diff --git a/src/sammo/Session.php b/src/sammo/Session.php index 182a6670..fa0ab286 100644 --- a/src/sammo/Session.php +++ b/src/sammo/Session.php @@ -79,7 +79,7 @@ class Session { } public function __set(string $name, $value){ - if(key_exists($key, self::PROTECED_NAMES)){ + if(key_exists($key, $this->PROTECED_NAMES)){ trigger_error("{$name}은 외부에서 쓰기 금지된 Session 변수입니다.", E_USER_NOTICE); return; } @@ -110,6 +110,7 @@ class Session { $this->set('ip', Util::get_client_ip(true)); $this->set('time', time()); $this->set('userGrade', $grade); + $this->set('access_token', null); return $this; }