Good day.I am trying to use session variables but can not seem to get it to work. I attach my scripts.I do start the session in both the first script Test.php looks like this
<?php
// Start the session
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
?>
and the second script test1.php looks like this
<?php
// Start the session
session_start();
?>
<!DOCTYPE html>
<html>
<body>
<?php
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
?>
</body>
</html>
when i run the first one,i get the message that the variables was set.But when i run the second script,it do not show the variables.It is just blank.
i realy would appreciate any help
var_dump($_SESSION)
result? - Vüsal Hüseynli