//Must be added before use;
session_start();
?>
//Consider we have When considering whether to write session
if (isset($_POST[userid])){
//If you really agree to write:
$_SESSION[userid] = $ccdot
}else{
//or return cannot be written to session
}
?>
When you want to clear:
session_start();
unset($_SESSION[userid]); //OR : session_register(username);
The main function of the session_unregister() function is to unregister the current A session variable. But please note that if you use $HTTP_SESSION_VARS or $_SESSION on the current page