Hi,
I am working with COOKIES and getting problem. The problem arises on Windows /IIS server and work fine in Linux / Apache.
For example
After a member posted his user id / password from a page to php page then i set a cookie that member has been successfully login and redirect to him on a new page.
//////////////////////////////////////////////////////
<?php
// login.php page
if (($_POST['user'] == 'admin') && ($_POST['pass'] == 'pass'))
{
setcookie("login_status", 1);
}
header('Location: private/index.php');
?>
//////////////////////////////////////////////////////
<<?php
// private/index.php page
if(isset($_COOKIE["login_status"]))
{
$status = $_COOKIE["login_status"];
if ($status == 1)
echo 'login Success';
}
else
{
echo 'error login';
}
?>
//////////////////////////////////////////////////////
The above page works fine on Linux / Apche system and shows 'login Success' message but i get message 'error login' on windows 2000 / IIS server.
if i do not redirect the login.php page to private/index.php and show a message to client that you have been successfully login and redirect from HTML tag then its work fine.
Can you please figure out why cookie behavie different on different servers?
Regards,
Aamir Javid (PHP Web Developer)
Web : http://www.phptrack.com
email: info@phptrack.com