SUNIL16 Posted February 17, 2009 Share Posted February 17, 2009 Hi Friends, I am using the below script for login, But the problem is cookie is setting only if they login twice. this is my code <?php require "config.php"; $username=$_REQUEST["uname"]; $password=md5($_REQUEST["password"]); $sql="SELECT usersid,username,password FROM users WHERE username='$username' and password='$password'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $memberid=$rows['usersid']; $count=mysql_num_rows($result); if($count == 1) { setcookie("myusername", "$username",time()+3600); header("Location:welcome.php"); exit(); } else { include("re_login.html"); exit(); } ?> Please help... if they login second time it is setting... Link to comment https://forums.phpfreaks.com/topic/145518-cookie-is-not-setting-in-first-login/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.