okay so i have this page random name , hello.php
i put this on top
<?php
require 'zwinky.class.php'; // require zwinky
zwinky::authenticate_login(); // authenticates user, redirects user to login.php if they are not logged in.
?>
and on my zwinky.class :
// Authenticate login function.
public static function authenticate_login() {
session_start();
if ( !isset($_SESSION['username']) | !isset($_SESSION['password']) | !isset($_SESSION['session']) ) {
header('Location: login.php');
}
}
okay when i go on the page hello.php for example yes it shows the login form of course cause i am not logged in and it redirects to
login.php BUT i login and it refreshes and doesnt leave the login.php, also when i go straight to the login it wont go to the hello.php
cause its somehow leading it back even though i enter correct details