Jump to content

What shall i say to my hosting..session_start


manalnor

Recommended Posts

I'm a new PHP/MySQL developer and have been working on my first site on my local machine. Today, I registered a domain and took up hosting so I could start testing in an actual web environ.

 

Now, I'm getting a problem with session_start(). I know that it has to come before anything is printed to the browser, and it works fine on my local machine.

 

so what should i tell me hosting support to makes session_start() works ... !

 

Thanks!

What exactly problem do you get? Any error messages?

 

i do login into my website as admin .. when i logged i will find link pointed me to admin/index.php when i click on it, it said NO_AUTHORIZE

 

the index.php file

include_once('authenticate.php');

 

 

and authenticate.php code it

 

<?php
session_start();
include_once('../common/common.php');
$isAdmin = $_SESSION['isAdmin'];
$isMember = $_SESSION['isMember'];
$sessionid = $_SESSION['sessionid'];
if ($sessionid != session_id()) {
popup(DF_NO_AUTHORIZE);
openwindow(DIR_UP . FILE_INDEX, PARENT);
die (DF_NO_AUTHORIZE);
} else if (!$isAdmin) {
popup(DF_NO_ACCESS);
openwindow(DIR_UP . FILE_INDEX, PARENT);
die (DF_NO_ACCESS);
}
?>

 

but for unknown reason it gives me NO_AUTHORIZE ....

however it works fine on my local machine.

 

so i guess there is something wrong wrong in hosting about session_start()  !!

Not necessarily.

Do you have error reporting enabled and set to E_ALL?

 

No i don't have, what makes me sure that the error in with session_start() as it gives me error which should appears only if i'm not logged.. hence it can't call the printed to the browser

Archived

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

×
×
  • Create New...

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.