> > what does print_r($_SESSION); show?
>
> Nothing. Its shows nothing.
> session_start() is the first line and Im not doing anything I haven't done
> before. I'm clearing my cache (which shouldn't affect this) to see if it
> helps.
>
> I'm a bit puzzled.
>
> Wade
Is your opening PHP tag at the top of the file with no lines or characters
above? Sessions rely on HTTP headers and these need to be written before other
content is sent to the browser. If the "_____" represented the top of the
file, it should be something like this:
_____
<?php
session_start();
$_SESSION['varname'] = "value";
if ($_SESSION['varname'] == "value");
{
header("Location: http://www.google.com\r\n");
}
print "Didn't see the session variable";
?>
_____
I tested this code on my server and it works as expected. Notice the "\r\n" at
the end of the header statement. This is part of the HTTP standard as are the
single space after the colon and the capital L in Location.
Perhaps you are not displaying your errors (eg: error_reporting in php.ini)
and you are not seeing the headers cannot be written because they've already
been sent type of error.
A single space or echo or print statement before the function calls which work
with the headers can generate that error.
Also, watch the spelling and capitalization of $_SESSION as either problem
would refer to a different variable in PHP.
James