protected function __construct() { $this->session = Hayate_Session::getInstance(); $this->cookie = Hayate_Cookie::getInstance(); $this->db = Hayate_Database::getInstance(); if ($this->session->exists(self::AUTHID)) { $this->identity = $this->session->get(self::AUTHID); $this->status = self::SUCCESS; } else { if ($this->cookie->exists(self::AUTHID)) { $this->identity = $this->cookie->get(self::AUTHID); $this->session->set(self::AUTHID, $this->identity); $this->status = self::SUCCESS; } else { $this->status = FALSE; $this->identity = NULL; } } }