I was trying to append some values in already exists session.

Code:
if(isset($_SESSION['ems_id']) == NULL) {
    echo "empty";
    $_SESSION['ems_id'] = "0";
    $_SESSION['ems_amt'] = "0";
             }
  
$ix = count($_SESSION['ems_id']);
$ix++;
 
$_SESSION['ems_id'][5] = strval($rowEms['hs_id']);
$_SESSION['ems_amt'][5] = strval($rowBuy2['hs_ems']);
Its not working
Session stores new data but not populates - Just replacing.