Jump to content

Archived

This topic is now archived and is closed to further replies.

brown2005

stop duplicate entry

Recommended Posts

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 in

thanks

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[code]
<?php
if($_SESSION['member_id']){
header("location: index.php");
}
?>
[/code]

Share this post


Link to post
Share on other sites
Guest huey4657
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]

Share this post


Link to post
Share on other sites

×

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.