Generally speaking when I'm checking if a variable is set I also check it to see if it is "" like this:
if(isset($_SESSION['cost']) && $_SESSION['cost'] != ""){
This will ensure that the variable is set and not empty. Along with this any time you are using a session variable on a page you will need to ensure that the session has been started, you can do that with some code like this:
if(!session_id())session_start();
This is a one line if statement checking for the session id, if it is not there then the session is started.