在页面之间传递会话

I am going to pass the variables from the previous page to the current page using session with the code below:

Previous page :

<?php   

session_start();
$job_remarks = 'ASAS'; 

$_SESSION["ref"] = $job_remarks ;
echo  $_SESSION["ref"] ; 

..
<form id="employee" name="employee" method="post" action="nextapge.php">  
<input type="submit" value="Apply Now">

Current Page: (nextpage.php)

<?php   

session_start();

$refernce = isset($_POST['ref']) ? $_POST['ref'] : $_SESSION["ref"];

$refernce  =   $_SESSION["ref"];
    echo $refernce;

It works in the locahost but not in the web host. What would cause it to fail on the web host's server?