Actually, you can probably get away with this for delete:
Code:
$_SESSION['portfolio'] = str_replace(',' . $_GET['reference'], '', $_SESSION['portfolio']);
Header('Location: portfolio.php');
As long as you don't get any problems, that would be far more efficient.