Howdy, (first of all, sorry if not well explained) I’m a pretty new in php.
Let me explain my issue. I using a free help desk code in PHP in 3 different folders, same domain:
ie
website com/folder1
website com/folder2
website com/folder3
each domain has it own approved users (login). I’ve found that if an approved user has logged in website.com/folder1 if he change the URL to website/folder2 he will keep logged (despite he’s not an approved user to website/folder2, if you know what I mean. It’s like the code does not validate the session in folder/path. I’ve read a lot of PHP tutorial but I’m seriously lost.
On login.PHP I have this var:
//record some details about this login
$lastip = $_SERVER[‘REMOTE_ADDR’];
Than on session.php (I think this is the right one) I have this code.
<?php
//check to make sure the session variable is registered
if(isset($_SESSION['user_id'])){
$user_name = $_SESSION['user_name'];
$user_id = $_SESSION['user_id'];
$user_level = $_SESSION['user_level'];
$take_email = $_SESSION['user_email'];
}
else{
echo "<script>document.location.href='/?e=1'</script>";
exit;
}
?>
I have tried a lot of and everything I try, it simply does not work (the website turn into a blank page, can’t figure out what is wrong).
I think this is related to session_get_cookie_params(), store the path and do a check (session.php?).