status = $status; $this->message = $message; } public function send() { if ($this->status == 'error') { //Cookie to prevent trying autologin again and again. // After 1 hour the cookie expires and autologin is tried again. setcookie('tried-autologin', '1', time() + 60 * 60); } $data = htmlspecialchars(json_encode($this), ENT_NOQUOTES); header('Content-type: text/html'); echo << Autologin response XML; } } ?>