title: Logout.php does not destroy cookie or login
body: <p><strong>I have a logout.php link, which if the user clicks it is supposed to log them out.</strong></p>
  
  <pre><code>&lt;?php
      // logout.php
      // you must start session before destroying it
      session_start();
      session_unset();
      session_destroy();
      //}
      //echo "You have been successfully logged out.
  ?&gt;
  </code></pre>
  
  <p><strong>However, when I return back to the login.php - it automatically redirects them to the landing page after login.php.
  Below is the code for login.php</strong></p>
  
  <pre><code>&lt;?php 
  
       // Connects to your Database 
  
       mysql_connect("localhost", "root", "") or die( mysql_error() ); 
       mysql_select_db("sales") or die( mysql_error() );
  
      //Checks if there is a login cookie
  
      if( isset( $_COOKIE['ID_my_site'] ) ) {
  
          //if there is, it logs you in and directes you to the members page 
          $username = $_COOKIE['ID_my_site']; 
          $pass = $_COOKIE['Key_my_site'];
  
           $check = mysql_query("SELECT * FROM users WHERE username = '$username'") or die( mysql_error() );
           while( $info = mysql_fetch_array( $check ) ) {
              if ( $pass != $info['password'] ) {
              } else {
                header("Location: sales.php");
              }
           }
       }
  
       // if login is ok then we add a cookie 
       $_POST['username'] = stripslashes($_POST['username']); 
       $hour = time() + 3600; 
       setcookie( ID_my_site, $_POST['username'], $hour ); 
       setcookie( Key_my_site, $_POST['pass'], $hour );    
  
       //then redirect them to the members area 
  
       header("Location: sales.php"); 
  </code></pre>