unable to use login session across pages in php
<p>I am unable to pass login session information to other HTML pages. Below is my login php code. I can successfully login but cant pass on the information to other pages like HTML home page and it gets opened though I am not logged in to same. I tried different codes for the same</p>

<pre><code>&lt;?php

require_once("config.php");

$email=$_POST['email'];
$password=$_POST['password'];

$email = stripslashes($email);
$password = stripslashes($password);
$email = mysql_real_escape_string(strip_tags($email));
$password = mysql_real_escape_string(strip_tags($password));

// Check occurence of email password combination
$sql="SELECT * FROM register WHERE email='$email'";
$result=mysql_query($sql); 


// Mysql_num_row is counting table row
$count=mysql_num_rows($result);

// If result matched $email, table row must be 1 row
if($count==1)
{
$row = mysql_fetch_array($result);
if($password == $row['password'])
{
session_start();
$_SESSION['login'] = "1";
header("location:home.html");
exit;
}
else 
{
echo "Please enter correct Password";
header("location:login.html");
session_start();
$_SESSION['login'] = '' 
exit();
}
 }  
else
{
header("Location:register.html");
exit();
}

?&gt;


Below is the php snippet that I use at the top of my HTML page:
&lt;?php

require_once("config.php");
session_start();
if (!(isset($_SESSION['login']) &amp;&amp; $_SESSION['login'] != '')) {

header ("Location: login.html");

exit;

}
?&gt;
</code></pre>
