title: PHP login system, safe?
body: <p>is it safe to use this code publicly?</p>
  <pre><code>&lt;?php 
      session_start();
      if($_POST['name'] == &quot;user&quot; &amp;&amp; $_POST['password'] == &quot;password&quot;)
      {
          $_SESSION['auth'] = 412;
          $_SESSION[&quot;password&quot;] = $_POST['password'];
          header('Location: login.php');
          exit();
      }
  ?&gt;
  </code></pre>
  <p>In login.php</p>
  <pre><code>&lt;?php
  session_start();
  if(!isset($_SESSION['auth']) || $_SESSION['auth'] != 412 || !isset($_SESSION[&quot;password&quot;]) || empty($_SESSION[&quot;password&quot;]))
  {
      header('Location: index.php');
      exit();
  }
  ?&gt;
  </code></pre>
  <p>I just need some verification to enter login.php...</p>