Web design seattle - Chapter 5: Central Authentication System 139 The logout

Chapter 5: Central Authentication System 139 The logout application checks to see whether the user is logged in. If the user is not logged in, she is warned of her status. If the user is logged in, her session is terminated and the user is redirected to a home URL. Listing 5-7 implements this flowchart in logout.php. Listing 5-7: logout.php getRequestField( email ); $password = $this->getRequestField( password ) ; $url = $this->getRequestField( url ); $emailLen = strlen($email); $passwdLen = strlen($password); $this->debug( Login attempts : . $this->getSessionField( SESSION_ATTEMPTS )); if ($this->is_authenticated()) { // return to caller HTTP_REFERRER $this->debug( User already authenticated. ); $this->debug( Redirecting to $url. ); $url = (isset($url)) ? $url : $this->getServer(); header( Location: $url ); Continued

Leave a Reply