Hi,
I have a really weird problem with Sessions.
On my site there is a 'private' part, which you can only access with a username/password.
To check if you're authorized, I set a session:
$_SESSION['authed'] = true;
Then to check it on a page, I do this:
?
session_start();
if(!($_SESSION['authed']))
{ /* User NOT Cleared: display unauthorized access*/
echo "<font color=#ff0000><Center><b>**You're not Authorized to see this page**</b></Center></font>";
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="../styles.css" type="text/css" rel="stylesheet">
...
...
...
Now this works fine on a number of pages.. but there are two pages that are just not working. I've copied an other .php file with this check, and changed only the stuff in the <body> part, stil it refuses access..
If I run it localy on my home PC with PHP, it works fine...
PHP version I use at home is:
- PHP Version 5.0.3-dev
PHP version at my provider is:
- PHP4u Version 3.0
Based on PHP-4.3.10
So in general, why do a number of pages work fine with the $_SESSION, but only two do not, and I've tripple checked them for errors, made copies of working ones, still the don't see that the session is set... 😕