cookie problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tisa
Forum Commoner
Posts: 27
Joined: Fri Nov 28, 2003 1:14 am

cookie problem

Post 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>";
?>
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post 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']
tisa
Forum Commoner
Posts: 27
Joined: Fri Nov 28, 2003 1:14 am

Post 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
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

the problem there is...

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