I'm making a web app. When I log into page 127.0.0.1:5000, if the login_user session variable is not set, then it should bring me back to the index, because I haven't logged in yet. However, this does not happen, and for this reason every time I type 127.0.0.1:5000 in the search bar I'm directed to this page even without login, can anyone give me an explanation? This is the part in the 127.0.0.1:5000 php file where I redirect:
<?php
session_start();
if(!isset($_SESSION["login_user"])){
header('location: http://127.0.0.1');
exit(0);
}
?>
<html lang="en">
<head>
...
Anyone can help me?
Aucun commentaire:
Enregistrer un commentaire