I have the following code in login page:
<?
/* Connect to MySQL-Server */
...
/* Open $db */
...
$user=strtolower($_POST['usernamelogin']);
$pswr = $_POST['passwordlogin'];
$crypt_pswr=md5 ($pswr);
$query ="SELECT * FROM users WHERE
usernamemem = '$user'
AND " ."
cryptpswr = '$crypt_pswr'";
$result = mysql_query($query) or die("ERROR: " . mysql_error());
if(mysql_num_rows($result) > 0) # we found a match, so set $_SESSION flag:
{
$_SESSION['logged'] = TRUE;
setcookie ('usernamelogin','',(time()+(60*60*24*30)),'/','',0);
setcookie ('id_hash','',(time()+(60*60*24*30)),'/','',0);
if(isset($_SESSION['caller']))
# if we got here from another page, go there
{
header("Location: " . $_SESSION['caller']);$loginvalid=1;
}
else
# otherwise go to main page
{
header("Location: home.php");$loginvalid=1;
}
}
else
# invalid login, so create error message
{
if ($validation=='true'&& (mysql_num_rows($result)==0))
{$errorinput="This <b>Username or Password</b> is not valid!<br />"; }
else {$errorinput==""; }
}
?>
When I test to show COOKIES, there is not
shown COOKIES usernamelogin and id_hash
Do you know why is just shown:
$_COOKIE['PHPSESSID'] = = 3e7d6fee8faca7421934bf7097bb812f