I've started a session in a php file and also the session variable is been assigned with the result of the query successfully, I've even tried displying it in the same page it works perfectly fine.. but when I try accessing that particular session variable in a other page is shows it's not set..
here are the code snippet: page1.php
$email=$_POST['email'];
$password=$_POST['password'];
$query="Select * from sign_up where email='$email'";
$resultObj=$connection->query($query);
$row=$resultObj->fetch_assoc();
//print_r($row);
if(strcmp($password,$row['pass'])==0){
session_start();
$_SESSION['signin']=$row;
if(isset($_SESSION['signin'])){
echo "Assigned\n";
print_r($_SESSION['signin']);
}
Page2.php
<?php
session_start();
if(isset($_SESSION['signin'])){
print_r($_SESSION['signin']);
}else{
echo "Not Set..";
}
?>
It shows not set in page2.php even though it's set in page1..
Note:both page1.php and page2.php are in different folders, I assume that ain't a big deal.