Hi I spent a few days recently figuring this out...
Basically first you need to start you doc like this (ie at the very top of the page, before the html headers etc)
<?php
session_start();
This is important I could not get it working otherwise.
Then simply create your $_SESSION variables like this (can be done in or out of a function);
$_SESSION['sessionvariable'] = $someothervariable ;
Then you can call your session variables like this:
$newvar = $_SESSION['sessionvariable'] ;
SO now $_SESSION['sessionvariable'] will always (even after page refresh / change) be assigned the value $someothervariable until you either unset it or change it.
Have a look at :
PHP Manual - session register
Hope this is understandable and helps.