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 Link to comment https://forums.phpfreaks.com/topic/17220-stop-duplicate-entry/ 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... Link to comment https://forums.phpfreaks.com/topic/17220-stop-duplicate-entry/#findComment-72954 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 Link to comment https://forums.phpfreaks.com/topic/17220-stop-duplicate-entry/#findComment-72957 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] Link to comment https://forums.phpfreaks.com/topic/17220-stop-duplicate-entry/#findComment-72967 Share on other sites More sharing options...
brown2005 Posted August 11, 2006 Author Share Posted August 11, 2006 wats that mean? Link to comment https://forums.phpfreaks.com/topic/17220-stop-duplicate-entry/#findComment-72972 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] Link to comment https://forums.phpfreaks.com/topic/17220-stop-duplicate-entry/#findComment-72981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.