I am supposed to assign "Hi stranger" as a session cookie. Am I doing this correctly? I see assigning a string to a cookie and assigning a value to a variable as the same thing.
Also, how do I print $_SESSION['sess_var']
in the same line as "Hi stranger"?
<?php
$sess_thanksgiving = "Turkey, gobble gobble";
$sess_christmas = "Santa Clause";
session_start();
?>
<html>
<head>
<title></title>
</head>
<body>
<?php
$_SESSION['sess_var'] = "Hi stranger";
$_SESSION['sess_christmas'] = "Santa Clause";
$_SESSION['sess_thanksgiving'] = "Turkey, gobble gobble";
echo "The session ID is ".session_id();
echo "<br>Page 1 <br>";
echo "The content of the session variable is " .$_SESSION['sess_var']."<br>";
echo "Two or more elements were added to <br>";
?>
<a href="part2.php">Next Page</a>
</body>
</html>