Page 1 of 1

cookie problem

Posted: Wed Feb 25, 2004 8:57 pm
by tisa
I use cookie to save user login name and password, then the user don't need to login again next time.

the following code just for testing...but it seems the cookie did save the value, help me pls~~~

<?
$data0 = $data1;
$data1 = $data1 + 100;
setcookie( "data1", $data1 );

echo "comming the site, \$data1=$data0<BR>";
echo "leaveing the site, \$data1=$data1<BR>";
?>

Posted: Wed Feb 25, 2004 9:11 pm
by AVATAr
"I use cookie to save user login name and password, " i dont recomend that... it could be a big security risk..

check $_COOKIE['data1']

Posted: Wed Feb 25, 2004 9:20 pm
by tisa
thank you very much.!! it work now...

i also don't want use cookie . but my system has to provide one function, if the user allow to use cookie to save login info., then next time user don't need to login again.


do you have another suggestion

Posted: Wed Feb 25, 2004 9:22 pm
by AVATAr
the problem there is...

what if another user use the same computer????