Refactoring a header location function
<p>Should this function be:</p>

<pre><code>check_login_session()
{
   if (!isset[$_SESSION['user_auth']) )
   {
      header('Location: login.php');
   }
   else
   {
      #  check against database here?
      return $_SESSION['user_auth'];
   }
}
</code></pre>

<p>Or, should a header be send out after the function has been called:</p>

<pre><code>check_login_session()
{
   if (!isset[$_SESSION['user_auth']) )
   {
      return false;
   }
   else
   {
      #  check against database here?
      return $_SESSION['user_auth'];
   }
}
</code></pre>

<p>so, when it is called:</p>

<pre><code>if (check_login_session === false)
{
   header('Location: login.php');
}
</code></pre>

<p>I know the code does essentially the same thing, but what is the <em>most</em> 'proper way' to refactor this?</p>
