Double Sessions

Started on the old forum in December 2007 · view the original in the archive · old links redirect here

5 replies · 953 views · started 18 years ago · 1 min read

4 participants
WhiteWarrior Principal · 1,419 posts #1

If someone was login on the lava script with a one phone then login with a diff phone how do i delete the old session as soon as they login with the diff phone? if you know what i mean?..

the delete session code when they logout is

mysql_query("DELETE FROM ibwf_ses WHERE uid='".$uid."'");

External image (may be gone) External image (may be gone)

amylee Principal · 1,092 posts #2

with my new script when lets say user A allready is logged in and another person user B logs into user A's username with a different ip/browser than what user A is using that session id is automatically deleted and user A will have to login again

}
function logged($sid)
{

    if(trim($sid)=="")return false;
    $loginfo = mysql_fetch_array(mysql_query("SELECT uname, upwd, ipadd, browser FROM rwc_sessions WHERE sid='".$sid."' LIMIT 1"));
    if($loginfo['uname']==0||$loginfo['uname']==""||!isuser($loginfo['uname']))
    {
        
        return false;
    }
    //password is out of date
    $uinfo = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM rwc_users WHERE id='".$loginfo['uname']."' AND pass='".$loginfo['upwd']."'"));
    if($uinfo[0]==0)
    {
        return false;
    }
    
    global $ubr; global $uip;
    if($uip!=$loginfo['ipadd']||$ubr!=$loginfo['browser'])
    {
        autopm(1, $loginfo['uname'], 'IP: '.$uip.'[br/]Browser: '.$ubr.'[br/]has guessed your session ID, though they cant login its necessary to forward this PM to an Admin');
        return false;
    }
    return true;
}
function isuser($uid)
{
    $isit = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM rwc_users WHERE id='".$uid."'"));
    if($isit[0]>0)
    {
        return true;
    }
    return false;
}
function sid2uid($sid)
{
    $theuid = mysql_fetch_array(mysql_query("SELECT uname FROM rwc_sessions WHERE sid='".$sid."' LIMIT 1"));
    return $theuid[0];
}

thats how i block users logging in to same session there is more to it but i cant be bothered looking at 240 files for the code

wizard Senior · 493 posts #3

thats how i block users logging in to same session there is more to it but i cant be bothered looking at 240 files for the code

wow 240??? thats insane, nways using php sessions n cookie instead of this md5 authentication system will eliminate that problem

modfiles Developer · 200 posts #5

with my new script when lets say user A allready is logged in and another person user B logs into user A's username with a different ip/browser than what user A is using that session id is automatically deleted and user A will have to login again

}
 function logged($sid)
 {
 
     if(trim($sid)=="")return false;
     $loginfo = mysql_fetch_array(mysql_query("SELECT uname, upwd, ipadd, browser FROM rwc_sessions WHERE sid='".$sid."' LIMIT 1"));
     if($loginfo['uname']==0||$loginfo['uname']==""||!isuser($loginfo['uname']))
     {
         
         return false;
     }
     //password is out of date
     $uinfo = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM rwc_users WHERE id='".$loginfo['uname']."' AND pass='".$loginfo['upwd']."'"));
     if($uinfo[0]==0)
     {
         return false;
     }
     
     global $ubr; global $uip;
     if($uip!=$loginfo['ipadd']||$ubr!=$loginfo['browser'])
     {
         autopm(1, $loginfo['uname'], 'IP: '.$uip.'[br/]Browser: '.$ubr.'[br/]has guessed your session ID, though they cant login its necessary to forward this PM to an Admin');
         return false;
     }
     return true;
 }
 function isuser($uid)
 {
     $isit = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM rwc_users WHERE id='".$uid."'"));
     if($isit[0]>0)
     {
         return true;
     }
     return false;
 }
 function sid2uid($sid)
 {
     $theuid = mysql_fetch_array(mysql_query("SELECT uname FROM rwc_sessions WHERE sid='".$sid."' LIMIT 1"));
     return $theuid[0];
 }

thats how i block users logging in to same session there is more to it but i cant be bothered looking at 240 files for the code

Where will I put that code????

Guest #6

Where will I put that code????

This code for rawingwap scripts, put code in core.php

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close