when user click add to cart i need add product id to session of user like this :
if(isset($_POST['link']) AND !empty($_POST['link'])){
$link = sanitizeString($_POST['link']);
if(isset($_SESSION)){
$arr = array('bascket'=> 1 , 'id'=> $link);
array_push($_SESSION , $arr);
//$_SESSION[][] = array('bascket'=> 1 , 'id'=> $link);
print_r($_SESSION);
but it not work add new id on previous id and show just 1 row Array ( [bascket] => 2 [0] => Array ( [0] => Array ( [bascket] => 1 [id] => 3 ) ) )
how can add new row in session?