Page not redirecting, php
<p>Page is not redirecting to the login screen when session value not set. I have echo the value and checked. Session value not exists, even then page not redirecting following is my code.</p>

<pre><code>if(!isset($_SESSION['user']))
{
    header("Location: index.php");
}
</code></pre>