Well it would depend on your needs. You could just do something like:
define('MAX_PAGES_STORED', 2);
if(empty($_SESSION['nav']))
$_SESSION['nav'] = array();
// and now to actually handle the storage of the navigation data...
array_unshift($_SESSION['nav'], 'info about current page here... e.g. filename or something');
if(count($_SESSION['nav']) >= MAX_PAGES_STORED)
$_SESSION['nav'] = array_slice($_SESSION['nav'], 0, MAX_PAGES_STORED);
Doing that would make $SESSION['nav'][0] be the current page, $SESSION['nav'][1] be 1 page ago, $_SESSION['nav'][$x] be $x pages ago, etc. etc. up until you reach the MAX_PAGES_STORED constant.