In this example, the session_start() function is called to start a session. Then, an if-statement checks if the "cart" key exists in the session. If it does, the value is pulled and stored in a variable called $cart. If it doesn't exist, an empty array is created and stored in the $cart variable. The array_push() function is used to add a new item ("product1") to the cart array. Finally, the updated cart array is stored back into the session. Package/Library: No package/library required as this is a built-in function in PHP.