Jump to content

sofia403

Members
  • Posts

    78
  • Joined

  • Last visited

Everything posted by sofia403

  1. ok, thank you guys, much appreciate the advise Guru. have an awesome day
  2. Thanks for reply. I will try to explain this again maybe it will make a little more sense at what I'm trying to achieve. Again lets say we have two users(UserA and UserB) who use the same computer at home. They both use the same browser to access a website, but each have their own account. Now UserA logs in to edit his profile in one tab, then while he is still logged in user UserB tries to edit her profile using the same browser only using a different tab. When UserB loged in to her account and if we go back to UserA tab and refresh it it will beUserB information. Im trying to prevent this from happening. So if one person is still logged in in one tab, the other person would be restricted to log in or the first one would be restricted to view the information about the second. does that make sense?
  3. I have a problem with login system. I have two users, userA and userB in the same computer. userA enters to his account in one browser; userB gets access to his account in the same browser. My system thinks that now userB is also userA and userA is still connected to its own account but his name appears as userB. If these two users get access into different browsers, there is NO problem. Do you have any idea how would i fix this so that users are restricted to only having one account the logged in to from one browser window? thanks Welcome.php <? session_start(); session_id(); if (empty($_SESSION['username'])){ header("location:login.php"); exit; } ?> login.php <? include('config.php'); session_start(); if(isset($_GET['reg'])){ $reg=$_GET['reg']; }else{ $reg=""; } if($reg==1){ $msg1="<font color=\"#009900\"><b>Your account has been created, please login</b></font>"; }elseif($reg==2){ $msg1="<font color=\"#009900\"><b>You have been successfully logged out.</b></font>"; } if(isset($_POST['submit'])){ if( empty($_POST['uname']) && (empty($_POST['upass']))){ header( "Location:Messages.php?msg=1" ); exit(); } //transfer to shorter var $n=mysql_real_escape_string($_POST['uname']); $p=mysql_real_escape_string($_POST['upass']); //put in session vars $mytime=time(); $mytime=date("H:i:s A",$mytime); $_SESSION['time'] = $mytime; $_SESSION['status'] = 'logged'; $_SESSION['username'] = $n; //goto next page header("location:welcome.php"); exit; }else{ $_SESSION['status'] = 'not logged'; header( "Location:Messages.php?msg=2" ); exit(); } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.