在foreach循环中使用$ _SESSON来传递记录ID而不使用GET

I am trying to pass a SESSION variable so that the user can edit something but when I use $_SESSION, the last record ID is the one set.

I read that I should use

$_SESSION['property_id'] = array();
  foreach($property_data->results() as $pdata) {
    echo '<ul>';
    echo '<li>' . $pdata->prop_name . '</li>';  
    $prop_num = $pdata->id;
    $calendar_record = DB::getInstance()->singleCalendar('reservations', array('user_id', '=', $user_id, 'property_id', '=', $prop_num));
    $_SESSION['property_id'][] = $prop_num;
    if($calendar_record->count()) {
        echo '<li><a href="calendar-details.php">EDIT BOOKINGS</a>';
    } else {
        echo '<li><a href="calendar-add.php">CREATE FIRST BOOKING</a>';         
    }

    echo '</ul>';               
};

which I did and I have a _SESSION variable available on the next page as an array but what I don't understand is how do I know which one I am after, which one they actually clicked on?

So what I want to do is pass a SESSION variable but set it to the correct value when looping through numerous records and have that variable available on the next page.

Thanks!