Hi,
my requirement is to "when we close the browser it automatically signout the account". For that i am using the cookies and set the cookie expiration time as '0' . But it didn't work in mozilla and it works fine in IE.
Here is code i am using
logout.php
Any body please give the solution how can i resolve my problem.
please help me.Its urgent.
my requirement is to "when we close the browser it automatically signout the account". For that i am using the cookies and set the cookie expiration time as '0' . But it didn't work in mozilla and it works fine in IE.
Here is code i am using
Code:
<?
if(isset($_POST['submit'])){
$email=$_POST['email'];
$password=$_POST['password'];
setcookie("TestCookies", $email,0);
setcookie("TestCookies1", $password,0);
echo $_COOKIE['TestCookies'];
}
?>
<html>
<body>
<?
if(isset($_COOKIE['TestCookies'])){
echo "Welcome to ".$_COOKIE['TestCookies'];
echo "<br>";
echo "<a href=logout.php>Logout</a>";
}
else{
?>
<form name="form1" method="post" action="">
Email: <input type="text" name="email" value="" /><br />
Password: <input type="text" name="password" value="" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?
}
?>
</body>
</html>
Code:
<?
setcookie('TestCookies',"");
setcookie('TestCookies1',"");
header('Location:login.php');
?>
please help me.Its urgent.
Comment