I have a file in www.mywebsite.com/subfolder/test.php
that sets a few session variables as below:
$_SESSION['user'] = "OK";
$_SESSION['id'] = $row_user['id'];
$_SESSION['contact'] = $row_user['contact'];
and another file in the same directory that checks the session variable which displays the session data OK.
echo "session user".$_SESSION['user'];
But if I then go to any files outside the subfolder say www.mywebsite.com/index.php
and then go back to www.mywebsite.com/subfolder/test2.php
session_variables are all lost.
I have session_start() on all files in my website so why am I losing session data?