I have a file that checks login details and sets session variables as below:
File is located in www.mywebsite.com/subfolder/check_login.php
$_SESSION['user'] = "OK";
$_SESSION['id'] = $row_user['id'];
$_SESSION['contact'] = $row_user['contact'];
If I execute my test.php file below in www.mywebsite.com/subfolder/test.php
Session variables are OK,
But if I put test.php in my root folder www.mywebsite.com/test.php
session variables are not found?
echo "session user".$_SESSION['user'];
What is causing this and how can I rectify?
Thanks in advance for your feedback.