** SOLVED ** - Server Problem
As mentioned above, the session ids are the same on both pages but I can't access to the session variables. I need Session for a bigger project I created this to test it. I don't have any Idea why since the ids are the same.
First page:
<?php session_start();
echo "session started"
?>
<!DOCTYPE html>
<html>
<body>
<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
echo "<br>";
print_r(session_id());
echo "<br>";
echo "<a href='use.php'>Display</a>"
?>
</body>
</html>
Second Page:
<?php session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
// Echo session variables that were set on previous page
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
echo "<br>";
print_r(session_id());
?>
</body>
</html>
Favorite animal is .
bool(true)
oqqonnvpqctaccgt241a39dp50 – dben Feb 04 '17 at 18:39