Your code resets the session before every page load... which means it is exactly the same as using the post.
You had:
$_SESSION['cont'] = $_POST['contact_name'];
I fixed it by changing it to:
if (isset($_POST['contact_name'])) $_SESSION['cont'] = $_POST['contact_name'];