brown2005 Posted August 11, 2006 Share Posted August 11, 2006 hi i want to know how to stop duplicate entries when using php sessions.i mean say i open up one Internet Explorer and log in, if i open another Internet Explorer window, i want to be able to stop from login in on the second one, cause it is already logged inthanks Quote Link to comment Share on other sites More sharing options...
corbin Posted August 11, 2006 Share Posted August 11, 2006 uhhhh the login script... what does it set? As long as you keep 1 window of IE open it retains a session if i remember correctly... So In theory it should stay logged in... Quote Link to comment Share on other sites More sharing options...
brown2005 Posted August 11, 2006 Author Share Posted August 11, 2006 i have;$_SESSION['MemberID'] = $login_array['members_id'];session_register('MemberID'); i can open two internet explorer windows and log in on both of them with the same username and password Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 11, 2006 Share Posted August 11, 2006 [code]<?phpif($_SESSION['member_id']){header("location: index.php");}?>[/code] Quote Link to comment Share on other sites More sharing options...
brown2005 Posted August 11, 2006 Author Share Posted August 11, 2006 wats that mean? Quote Link to comment Share on other sites More sharing options...
Guest huey4657 Posted August 11, 2006 Share Posted August 11, 2006 Somewhere in the login script (usally when username and password have been validated) you need to set authentication[code]$_SESSION['auth'] = "yes";[/code]then the top of your pages goes something like this[code] session_start(); /* Check to see if user is logged in, if not send to login page. */ if(@$_SESSION['auth'] != "yes") { header("Location: Login.php"); exit(); }[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.