Page1.php:
Page2.php
The session can only be modified from the PHP code, it's unlike $_POST, $_GET, $_COOKIE etc
$_POST, $_GET, $_COOKIE
As an aside I think you can use empty() to simplify your conditional:
empty()