Autu Logout?

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

    #16
    how does your login work tell me and ill give you the auto logout code hard to just tell you without knowing your code its a 30 coding job

    Comment


      #17
      eg on ws i used a sessions system and last seen field in the database lastseen is updated everytime someone loads a page and is unique for every user i then just deleted all session ids from database where lseen was more than the total inactive time

      Comment


        #18
        well i just want a autologout so if a user is inactive for 15mins they get logged out , i currently use 'get' to send the username n password over a link an for a online list i just insert them to the database when they login , but if they dont click logout they stay on

        Comment


          #19
          if you post your logout script ill give you what you need for auto logout dude

          Comment


            #20
            my logout is just a delete sql to delete user from online table ,

            Comment


              #21
              yes post if ill give you new php to add to your script and sql and it will make auto logout what query do you use

              Comment


                #22
                DELETE FROM online
                WHERE user = '$user'

                Comment


                  #23
                  LOL WHY DO I THINK MATRIX 15 IS FLAREMOBILE

                  Click here!!!

                  Comment


                    #24
                    ok here is sql to alter your online table use it in phpmyadmin
                    Code:
                    ALTER TABLE `online` ADD `lseen` INT( 255 ) NOT NULL DEFAULT '0';
                    Add this function

                    Code:
                    function update_timeout($user){
                    $currenttime = time();
                    mysql_query("UPDATE online SET lastseen='$currenttime' WHERE user='$user'");
                    $limit = 420;  //timout in seconds (420 seconds is 7 mins)
                    $userlseen = time()-$limit;
                    mysql_query("DELETE FROM online WHERE lseen < $userlseen");
                    }

                    I havn&#39;t tested this for errors so any problems then post here

                    to use afer adding use

                    Code:
                    update_timeout($user);
                    $user is the var containg of the person that is logged in put it in main menu or a page that is updated frequently

                    Comment


                      #25
                      thnx will test it out

                      Comment

                      Working...
                      X