public static function run()
 {
     if (!($user = CookieController::readSessionCookie())) {
         header("Location: home");
     } elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
         if (UserDatabase::updateUser($user, $_POST)) {
             # First Name
             if (isset($_POST["firstName"])) {
                 $firstName = $_POST["firstName"];
                 if (strcmp($firstName, $user->getFirstName()) !== 0) {
                     $user->setFirstName($firstName);
                 }
             }
             # Last Name
             if (isset($_POST["lastName"])) {
                 $lastName = $_POST["lastName"];
                 if (strcmp($lastName, $user->getLastName()) !== 0) {
                     $user->setLastName($lastName);
                 }
             }
             # Email
             if (isset($_POST["email"])) {
                 $email = $_POST["email"];
                 if (strcmp($email, $user->getEmail()) !== 0) {
                     $user->setEmail($email);
                 }
             }
             # Handle
             if (isset($_POST["handle"])) {
                 $handle = $_POST["handle"];
                 if (strcmp($handle, $user->getHandle()) !== 0) {
                     $user->setHandle($handle);
                 }
             }
             # About
             if (isset($_POST["about"])) {
                 $about = $_POST["about"];
                 if (strcmp($about, $user->getAbout()) !== 0) {
                     $user->setAbout($about);
                 }
             }
             # Password
             if (isset($_POST["cur-password"]) && isset($_POST["new-password"]) && isset($_POST["confirm-password"])) {
                 $curPassword = $POST["cur-password"];
                 echo $curPassword;
                 $newPassword = $POST["new-password"];
                 $confirmPassword = $POST["confirm-password"];
                 if (strcmp($curPassword, $newPassword) !== 0) {
                     $user->setPassword($curPassword, $newPassword, $confirmPassword);
                 }
             }
             CookieController::setSessionCookie($user);
             header("Location: view-profile");
         } else {
             EditProfileView::show($user);
         }
     } else {
         EditProfileView::show($user);
     }
 }
 public static function refreshSessionCookie()
 {
     if (CookieController::cookieExists("session")) {
         $user = CookieController::readSessionCookie();
         CookieController::setSessionCookie($user);
         return $user;
     }
     return false;
 }
 public static function run()
 {
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         if (isset($_POST["handle"]) && isset($_POST["password"])) {
             $handle = $_POST["handle"];
             $password = $_POST["password"];
             if (UserDatabase::validatePassword($handle, $password)) {
                 $user = UserDatabase::getUserByHandle($handle);
                 if (CookieController::setSessionCookie($user)) {
                     header("Location: dashboard");
                 } else {
                     $user->setError("login", "LOG_IN_FAILED");
                     LogInController::show($user);
                 }
             } else {
                 LogInView::show(null);
             }
         }
     } else {
         LogInView::show(null);
     }
 }
<!DOCTYPE html>
<html>
<head>
	<title>CookieController Test</title>
</head>
<body>
	<?php 
include "../includer.php";
$params = array("firstName" => "John", "lastName" => "Cena", "email" => "*****@*****.**", "handle" => "johnCena", "about" => "Wrestling Champion");
$user = new User($params);
$user->resetErrors();
echo "<h1>setSessionCookie():<hr/>";
if (!CookieController::setSessionCookie($user)) {
    echo "<h3>Failure: returned false</h3>";
} elseif (is_null($_COOKIE) || !isset($_COOKIE["session"])) {
    echo "<h3>Failure: \$_COOKIE is null or session is not set</h3>";
} else {
    echo "<h3>Success</h3>";
}
echo "<h1>readSessionCookie():<hr/>";
if (!($user = CookieController::readSessionCookie($user))) {
    echo "<h3>Failure</h3>";
} elseif (empty($user->getFirstName())) {
    echo "<h3>Failure</h3>";
} else {
    echo "<h3>Success</h3>";
}
echo "<h1>refreshSessionCookie():<hr/>";
if (!($user = CookieController::refreshSessionCookie($user))) {
    echo "<h3>Failure</h3>";
} elseif (empty($user->getFirstName())) {