Aynı kullanıcı iki oturum dosyalarını oluşturuyor sayede I sorunlar yaşıyorum. Ben neler olduğunu görebiliyordu veritabanında bu oturum başladı. Ben bu sınıfta oturumları ayarı kaynaklanıyor olsun veya bu arkasında bazı programlama gaf olup olmadığını merak duyuyorum. Aşağıda birbirinden bir dakika içinde oluşturulan benim bilgisayardan hem oturumları şunlardır:
session_id session_data
kfmj13vi5o538mvi57at8th0n2 useradd|s:10:"xx.xx.62.69";redirect|s:10:"/index.php";
3bb0fkisndf3u0o1l3195iclh2 UID|s:1:"1";USERNAME|s:9:"kalpaitch";
Bir kullanıcı oturum açtığında, bazen (her zaman değil), 'UID' ve oturuma 'username' ekleyerek sorumlu sınıf tamamen yeni bir oturum oluşturmak için (yukarıdaki gibi) ve bu yüzden sayfa açmış sahip olarak kullanıcıyı kayıt yok gibi görünüyor Lütfen
This is a script someone else wrote, with the following path => loginform.php posts to validate.php which calls the method below.
function validateUser($username,$password, $redirect){
$password=md5($password);
if(get_magic_quotes_gpc()){
$username = stripslashes($username);
$password = stripslashes($password);
}
$sql = "SELECT id,username,password FROM users WHERE username='" . mysql_real_escape_string($username) . "' AND password='" . mysql_real_escape_string($password) . "' AND status='1' and verified=1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row["id"]){
session_start();
$_SESSION["UID"] = $row["id"];
$_SESSION["USERNAME"]=$row["username"];
header("location: http://www.xxx.com".$redirect);
}else{
unset($_SESSION["UID"]);
unset($_SESSION["USERNAME"]);
$sql = "select id,username,password from user where username='" . mysql_real_escape_string($username) . "' and password='" . mysql_real_escape_string($password) . "' and status='1' and verified=0";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row["id"]){
$_SESSION['login'] = 'Verify your account by email';
header("location: http://www.xxx.com".$redirect);
}else{
$_SESSION['login'] = 'Incorrect username or password';
header("location: http://www.xxx.com".$redirect);
}
}
}