Hi I am learning PHP and trying to build forum as a start. Forum You can do the test and see how login session doesn't respond properly. username: test password:test
<?php
//signout.php
include 'connect.php';
include 'header.php';
echo '<h2>Sign out</h2>';
//check if user if signed in
if(isset($_SESSION['signed_in']) && $_SESSION['signed_in'] == true)
{
//unset all variables
$_SESSION['signed_in'] = NULL;
$_SESSION['user_name'] = NULL;
$_SESSION['user_id'] = NULL;
$_SESSION['user_level'] = NULL;
echo 'Succesfully signed out, thank you for visiting.';
echo " test";
}
else
{
echo 'You are not signed in. Would you <a href="sign_in.php">like to</a>?';
}
include 'footer.php';
?>
You can log in but then through some pages it looks like you are not signed in or when trying to sign out it doesn't sign out properly.
The problem is with sessions on my web hosting server. Locally on my computer it works fine under WAMP. Tested another web hosting it works fine.
Not sure what is it...