View Full Version : Session Problem - Urgent Help Needed

08-29-2006, 01:30 PM
Hi Guys,

ok here is my problem

on my site i have 2 login pages, they both redirect to different locations
( for personal and business users )

After successfull login they create a session
called either 'business' or 'personal' and the value for the sessions
is the auto_increment id inumber

on the index page in the corresponding folders
personal or business, the code check for the corresponding session name

however my problem is that if i login as business i can then also access the personal area and vise versa

Here is the code from 1 of the login pages ( they are both similar with only name changes )

mysql_select_db($dbn, $dbc);
$loginquery = mysql_query("SELECT * FROM `business` WHERE email='$email' and password='$password'", $dbc);
$result = mysql_fetch_assoc($loginquery);
// Result Process
header("Location: buslogin.php?message=Invalid Username / Password</br>Please Try Again");
} else {
$GLOBALS['business'] = "$result[businessid]";
header("Location: business/index.php");

and here is the code on the page successfull login is redirected too

header("Location: ../buslogin.php");
} else {

anyone got any ideas as to why if im logged in and the session name business is set i can access a page that checks for a session called personal ?

this is extremely urgent as teh site is supposed to be going live in 2 days time, but i cant let it go live like this

please help


08-29-2006, 01:47 PM

i found the problem

on the login page at the top ( the form page which passes the data to the page i posted )

i checked the sessions but the location for successful redirection was the same

so that was the issue


08-29-2006, 07:13 PM
thats the best thing if u solve ur problem urself
with best wishes