<?php $name = $_SESSION['name']; // or: $name = $session->name; // or: $name = $session->get('name');