Ok well firstly if your using PHP 5 i would keep away from using session_register();
Use the $_SESSION to initate the variable e.g.
$_SESSION['userid']=1;
From there accessing it like so
echo 'Your userid is '.$_SESSION['userid'];
To destroy the session
unset($_SESSION['userid']);
Do not unset $_SESSION as that will delete the sessions variable.
If you rather not use that you can access it if I remember correctly be using the session name as a variable in your case
echo $userid;
However using session_register and using the variable in that way can cause some harm to the program if you have a variable of the same name.