Hi!
I validate a user and set a cookie woht the following sentence:
setcookie("usNi ck",$nickN,time ()+7776000);
setcookie("usPa ss",$passN,time ()+7776000);
then I want to validate if the cookie is set with the following
sentence and it seems to enter in the "else", so the cookie was not
established.
if(isset($HTTP_ COOKIE_VARS["usNick"]) &&
isset($HTTP_COO KIE_VARS["usPass"]))
{
$result = mysql_query("SE LECT * FROM usuarios WHERE nick='".
$HTTP_COOKIE_VA RS["usNick"]."' AND password='".
$HTTP_COOKIE_VA RS["usPass"]."'");
}
else
{
setcookie("usNi ck","x",time( )-3600);
setcookie("usPa ss","x",time( )-3600);
}
Can anyone help me with this? I mena, setting the cookie correctly
Regards,
Ezequiel
I validate a user and set a cookie woht the following sentence:
setcookie("usNi ck",$nickN,time ()+7776000);
setcookie("usPa ss",$passN,time ()+7776000);
then I want to validate if the cookie is set with the following
sentence and it seems to enter in the "else", so the cookie was not
established.
if(isset($HTTP_ COOKIE_VARS["usNick"]) &&
isset($HTTP_COO KIE_VARS["usPass"]))
{
$result = mysql_query("SE LECT * FROM usuarios WHERE nick='".
$HTTP_COOKIE_VA RS["usNick"]."' AND password='".
$HTTP_COOKIE_VA RS["usPass"]."'");
}
else
{
setcookie("usNi ck","x",time( )-3600);
setcookie("usPa ss","x",time( )-3600);
}
Can anyone help me with this? I mena, setting the cookie correctly
Regards,
Ezequiel
Comment