title: PHP - setcookie(); not working
body: <p>I've made a login, that sets a cookie with a value of the imputed email address, so in the global.php file, it stores an array of the users data using:</p>
  
  <pre><code>$email = $_COOKIE["PeopleHub"];
  $getuserdata = mysqli_query($con, "SELECT * FROM Earth WHERE email='$email'");
  $userdata = mysqli_fetch_array($getuserdata, MYSQLI_ASSOC);
  </code></pre>
  
  <p>The cookie isn't being set, I know this because I made a test file:</p>
  
  <pre><code>echo $_COOKIE["PeopleHub"];
  </code></pre>
  
  <p>It just made a blank page.</p>
  
  <p>The login code (where the cookie is set):</p>
  
  <pre><code>&lt;?php 
  include "global.php";    
  ?&gt;
  &lt;h2&gt;Login&lt;/h2&gt;
  &lt;?php 
      echo "We currently have &lt;b&gt;" . $usercount . "&lt;/b&gt; members, &lt;b&gt;" . $onlinecount . "&lt;/b&gt; of which are online. "; 
  ?&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;?php 
      if(isset($_POST["email"])){ 
          $email = $_POST["email"];
          $password = sha1($_POST["password"]);
          $check = mysqli_query($con, "SELECT * FROM Earth WHERE `email`='$email' AND `password`='$password'");
          $check = mysqli_num_rows($check);
          if($check == 1){
          setcookie("PeopleHub", $email, 0, '/');
          echo "We logged you in!";
          }
          else { 
              echo "We couldn't log you in!";
          }
      }
  ?&gt;
  &lt;form action="&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;" method="post"&gt;
      Email &lt;input name="email" placeholder="Email Address" required="" type="text"&gt;&lt;br&gt;
      Password &lt;input name="password" placeholder="Password" required="" type="password"&gt;&lt;br&gt;
      &lt;input type="reset" value="Start Over"&gt;
      &lt;input type="submit" value="Login"&gt;
  &lt;/form&gt;
  </code></pre>