I have declared the following session variable:
$_SESSION['articulos'] = array();
And this code adds an element in the array, but it only keeps the last element and not all of them:
$indice = $_GET["codigo"];
$_SESSION['articulos'] = array($indice => 1);
The idea is to store in session all selected products.