Im trying to create a login system that creates a session if the user logs in to the member page. Once in the member page they can press logout to end the session otherwise if they dont, whenever they open up the login page they are redirected to the member page with their details displayed as if they have just logged in again.
How can i do this?
So far ive got this to create the session:
$result = $conn->query($SQL);
//user information available in database
echo "Login successful";
echo "<br><br> re-directing to members page";
$_SESSION['userlogin'] = $User_login;
header ( 'refresh:5; url=member.php?id='.$Username ); //re-directing to member page
And ive added the if isset:
<?php //Start of the PHP script