title: Sessions not working in iPhone (Safari, Chrome)
body: <p>So I have a login page on my website, which works perfectly on my computer, both Safari and Chrome, but on my iPhone, it does not work. I tried testing some code to see what is wrong, and sessions are not working in Safari. What I'm doing is once they log in, their session is <code>$_SESSION['logged'] = true;</code> and get redirected to the account page. I am accepting cookies. Any help is appreciated. Thanks</p>
  
  <pre><code>&lt;?php
  session_start();
  $db = mysqli_connect(#,#,#,#);
  if (isset($_POST['submit'])) {
      $username = mysqli_real_escape_string($db, $_POST['username']);
      $password = mysqli_real_escape_string($db, $_POST['password']);
  
  
      $sql = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  
      $result = mysqli_query($db, $sql);
  
      if (mysqli_num_rows($result) == 1) {
      $_SESSION['username'] = $username;
       $_SESSION['logged'] = true;
       echo '&lt;script type="text/javascript"&gt;
         window.location = "http://example.com/index.php?page=account"
         &lt;/script&gt;';
  } else {
      echo '&lt;script&gt;';
  echo "Alert.render('Incorrect Username or Password.');";
  echo '&lt;/script&gt;';
  }
  }
  ?&gt;
  </code></pre>