title: PHP - Login form not working in IE8
body: <p>I've just uncovered a rather annoying IE8 problem affecting a login page I'm working with. The login form is working correctly in FF (3.6 - MAC &amp; PC), Chrome, Safari but does the equivalent of a refresh when you submit the UN/PW in IE8. No error, just a blank form looking me in the face.</p>
  
  <p><strong>PHP code on the login page:</strong></p>
  
  <pre><code>&lt;?php
  define('INCLUDE_CHECK',true);
  include 'includes/connect.php';
  
  session_name('tzLogin');
  session_set_cookie_params(2*7*24*60*60);
  session_start();
  
  if($_SESSION['id'] &amp;&amp; !isset($_COOKIE['tzRemember']) &amp;&amp; !$_SESSION['rememberMe'])
  {
      $_SESSION = array();
      session_destroy();
  }
  
  if(isset($_GET['logoff']))
  {
      $_SESSION = array();
      session_destroy();
  
      header("Location: login.php");
      exit;
  }
  
  if($_POST['submit']=='Login')
  {   
      $err = array();
  
      if(!$_POST['username'] || !$_POST['password'])
          $err[] = 'Sorry, all the fields must be completed.';
  
      if(!count($err))
      {
          $_POST['username'] = mysql_real_escape_string($_POST['username']);
          $_POST['password'] = mysql_real_escape_string($_POST['password']);
          $_POST['rememberMe'] = (int)$_POST['rememberMe'];
  
          $row = mysql_fetch_assoc(mysql_query("SELECT id,usr,permission,fullName FROM adidas_members WHERE usr='{$_POST['username']}' AND pass='".md5($_POST['password'])."'"));
  
          if($row['usr'])
          {
  
              $_SESSION['usr']=$row['usr'];
              $_SESSION['id'] = $row['id'];
              $_SESSION['fullName'] = $row['fullName'];
              $_SESSION['permission'] = $row['permission'];
              $_SESSION['rememberMe'] = $_POST['rememberMe'];
  
              setcookie('tzRemember',$_POST['rememberMe']);
          }
          else $err[]='Opps, wrong username and/or password.';
      }
  
      if($err)
      $_SESSION['msg']['login-err'] = implode('&lt;br /&gt;',$err);
  
      header("Location: dashboard.php");
      exit;
  }
  else {
  }
  
  $script = '';
  
  ?&gt;
  </code></pre>
  
  <p><strong>Login related code on the 'dashboard' (landing) page:</strong></p>
  
  <pre><code>&lt;?php
  session_name('tzLogin');
  session_set_cookie_params(2*7*24*60*60);
  session_start();
  
  error_reporting(E_ALL^E_NOTICE);
  define('INCLUDE_CHECK',true);
  include 'includes/connect.php';
  
  if(isset($_GET['logoff']))
  {
      $_SESSION = array();
      session_destroy();
      header("Location: login.php");
      exit;
  }
  ?&gt;
  </code></pre>
  
  <p><strong>Finally, the form code:</strong></p>
  
  <pre><code>&lt;form action="" method="post" class="contactForm" id="loginForm"&gt;
                  &lt;?php
                      if($_SESSION['msg']['login-err'])
                      {
                          echo '&lt;div class="error"&gt;'.$_SESSION['msg']['login-err'].'&lt;/div&gt;';
                          unset($_SESSION['msg']['login-err']);
                      }
                  ?&gt;
                  &lt;table class="loginTable" cellspacing="0"&gt;
                    &lt;tr&gt;
                      &lt;th width="50"&gt;&lt;label for="username"&gt;Username:&lt;/label&gt;&lt;/th&gt;
                      &lt;td&gt;&lt;input type="text" name="username" id="username" class="validate[required] textBox" /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;th&gt;&lt;label for="password"&gt;Password:&lt;/label&gt;&lt;/th&gt;
                      &lt;td&gt;&lt;input type="password" name="password" id="password" class="validate[required] textBox" /&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;th&gt;&lt;/th&gt;
                      &lt;td style="padding-top:5px;"&gt;&lt;input type="image" src="images/button_login.gif" alt="Login" name="submit" value="Login" /&gt;&lt;span class="remember"&gt;&lt;input name="rememberMe" id="rememberMe" type="checkbox" checked="checked" value="1" /&gt;Remember me&lt;/span&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>The only thing I can think of/find is that IE8 doesn't handle cookies very well. That said, I checked to see what cookies are being set and I'm told that tzLogin is (with an expiry date which is ages away).</p>
  
  <p>Note: My login page is based off this > <a href="http://tutorialzine.com/2009/10/cool-login-system-php-jquery/" rel="nofollow">http://tutorialzine.com/2009/10/cool-login-system-php-jquery/</a></p>
  
  <p>Hoping someone can help with this frustration!</p>
  
  <p>rrfive</p>