atleast i would use sessions , than the cookies . the advantage i get is that , even if the person didnt really LOGOUT , the moment the browser is closed , all my data is deleted.
for encryption , i would definitely encourage you to write your own function that wil convert the password into special characters that can be stored into the database.
IF your website is small and contains smaller users , its ok , let it be.
the sample code ( iv used it in one of ma websites , for simple use )
PHP:
<?php
session_start();
include('config.php');
// CONNECT TO DB DAMIT !
$conn = mysql_connect($dbhost, $dbuser , $dbpass);
mysql_select_db($dbname,$conn);
// helll yeah !
$sql = "SELECT * FROM userdetails";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($row = mysql_fetch_row($result)){
if($row[1]==$_POST[user1] and $row[2]==$_POST[pass1]){
$_SESSION[auth]=true;
$_SESSION[uid]=$row[1];
break;
}
}
?>
use this at the begining of your login page , and not in the body....
and make sure you start the session by using session_start() in every page where you want your authorized content.
cheers