How do I prevent multiple registrants from overwriting each other's cookies?
Here’s the problem:
1 household, multiple users who don’t log on or off. They are learning different languages. They come to the site to register and the registration part works fine. But, because they don't properly logon and off, the cookies that are set by the first registrant are overwritten by the second and so on. When someone returns to the site, the cookies set by the second or third registrant would take the 1st registrant to the wrong login page. Is there a standard solution for this (seemingly) obvious problem?
Any ideas like:
<?php if (isset) $_COOKIE[‘targ_lang’]; {
Rename this.new $_COOKIE['targ_lang'] to $_COOKIE[‘targ_lang2’];
}
?>
I could then read the cookies on the index.php with:
<?php if (isset) $_COOKIE[‘targ_lang’] and (isset) $_COOKIE [‘targ_lang2’] {
header('Location: http://www.xxx.com/a_page_displaying_both their_languages.php');
}
?>
That page would have a
Select your language:
<a href"http://www.xxx.com/Login/<?php echo $_COOKIE['targ_lang']; ?>.php"><?php echo $_COOKIE['targ_lang']; ?></a>
or:
<a href"http://www.xxx.com/Login/<?php echo $_COOKIE['targ_lang']; ?>.php"><?php echo $_COOKIE['targ_lang']; ?></a>
They could select their language and then go to the proper login page.
Bearing in mine my inexact syntax, does that make sense and does it look like it would work?
Or, back to my original question, is there a really obvious solution to the multiple user problem I'm overlooking? (as usual)
As always,
Thanks for your help.
Brian
