Oh dear, I'm having problems, It worked great for 5 mins, then all of a sudden it stopped, and I can see why. It keeps forwarding to the url, even if the session is registered. I know the session is being registered, because I have a test file that does
session_start();
print "Value of 'sUser': $sName ";
And that prints the session, so I can see its registered, however I can get to the page I put the code in.
Is the following right?
if (!session_is_registered($sName)) {
Header("Location: http://www.domain.com/login.php");
} else {
session_start();
}
I have tried $sName, sName, 'sName', and '$sName' all with out success, I'm sure this is what the problem is, I'm not calling the session correctly, any help greatly appreciated.