ok.....Here is the code.if(isset($remember)){ setcookie("rmbr_uname", $uname,time()+60*60*24*30); setcookie("rmbr_pswd", $pswd,time()+60*60*24*30);}include "dbconn.php"; $match=mysql_query("Select uname from userinfo where uname='$uname' && pswd='$pswd'");$unm=mysql_num_rows("$match");if($unm>=1){ if(isset($_COOKIE['rmbr_uname'], $_COOKIE['rmbr_pswd'])){ $user = mysql_query('SELECT uname FROM userinfo WHERE uname=?', $_COOKIE['rmbr_uname']); if($user) { $check_pass = mysql_query('SELECT pswd FROM userinfo WHERE pswde=?', $_COOKIE['rmbr_pswd']); //$check_pass = sha1( sha1($user['uname']) ); if($check_pass == $_COOKIE['rmbr_pswd']) { -----------------sessions part----------- } remember is the name of the check box n i hv fetched the value thru $remember=$_POST['remember'];at the top of the page.