Double Sessions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Double Sessions

    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
    Code:
    mysql_query("DELETE FROM ibwf_ses WHERE uid='".$uid."'");

    #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

    Code:
    }
    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

    Comment


      #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[/b]
      wow 240??? thats insane, nways using php sessions n cookie instead of this md5 authentication system will eliminate that problem

      Comment


        #4
        thanks peepz :-)

        Comment


          #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

          Code:
          }
           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[/b]

          Where will I put that code????

          Comment


            #6
            Where will I put that code????[/b]
            This code for rawingwap scripts, put code in core.php

            Comment

            Working...
            X