How can PHP values be passed to a second page when using a template system?

When using a template system in PHP, values can be passed to a second page by storing the values in a session variable on the first page and then accessing them on the second page. This allows the values to persist across multiple pages without the need to pass them through URLs or form submissions.

// First Page
session_start();
$_SESSION['value'] = 'Hello, World!';

// Second Page
session_start();
$value = $_SESSION['value'];
echo $value; // Output: Hello, World!