public function login($user, $pass) { if (Pep::auth_user($user, md5($pass))) { $data = $this->decrypt($_COOKIE[$this->cookie_name]); $data['user'] = $user; $data['pass'] = md5($pass); setcookie($this->cookie_name, $this->encrypt($data), $this->expires, '/', '', false, true); $this->logged_in = true; } else { $this->logged_in = false; } return $this->logged_in; }