2025-07-25 20:06:31 [::1][-][-][error][application] Invalid cart_data JSON structure: [{"id":1,"quantity":1,"available_quantity":4,"total_price":400}]; Context: {
    "cart data": [
        {
            "id": 1,
            "quantity": 1,
            "available_quantity": 4,
            "total_price": 400
        }
    ],
    "method": "app\\components\\services\\SessionUserService::writeSession",
    "file": "\/components\/services\/SessionUserService.php",
    "line": 189
}
```
private function validateCartData(array $cartData): bool
	{
		// Configuration: max allowed items in cart
		$maxItems = 10;
		
		if (count($cartData) > $maxItems)
		{
			$this->logDebug("Cart data exceeds maximum {$maxItems} allowed items: " 
				. count($cartData), [], 'validation');
			
			return false;
		}
		
		foreach ($cartData as $index => $item)
		{
			if (!is_array($item) || !isset($item['id'], $item['quantity']))
			{
				$this->logDebug("Cart item at index {$index} missing required keys or invalid format.", [
					'item' => $item,
				 ], 'validation');
				
				return false;
			}
			
			if (!is_int($item['id']) && !is_string($item['id']))
			{
				$this->logDebug("Cart item 'id' at index {$index} must be int or string.", [
					'id' => $item['id'],
				 ], 'validation');
				
				return false;
			}
			
			$qty = $item['quantity'];
			
			// Validate quantity is positive integer or string of digits
			if (!((is_int($qty) && $qty > 0) || (is_string($qty) && ctype_digit($qty) && (int) $qty > 0))
			)
			{
				$this->logDebug("Cart item 'quantity' at index {$index} must be a positive integer.", [
					'quantity' => $qty,
				 ], 'validation');
				
				return false;
			}
			
			// Optional: reject unexpected extra keys in cart items to avoid abuse
			$allowedItemKeys = ['id', 'quantity'];
			
			foreach ($item as $key => $value)
			{
				if (!in_array($key, $allowedItemKeys, true))
				{
					$this->logDebug("Unexpected key {$key} in cart item at index {$index}.", [
						'item' => $item,
					 ], 'validation');
					
					return false;
				}
				
				// Optionally reject nested arrays in item fields (no complex objects)
				if (is_array($value) || is_object($value))
				{
					$this->logDebug("Cart item value for key {$key} at index {$index} is nested array/object.", [
						'value type' => gettype($value),
						'item' => $item,
					 ], 'validation');
					
					return false;
				}
			}//*/
		}
		
		/**
		* Optional: Check total serialized length of cart_data JSON to prevent too large carts
		*/
		$encoded = json_encode($cartData);
		
		if ($encoded === false || strlen($encoded) > 8192)
		{
			$this->logDebug('Encoded extra_data JSON too large or failed to encode: ' 
				. ($encoded === false ? 0 : strlen($encoded)), 
				[
					'length' => $encoded === false ? 0 : strlen($encoded),
				 ], 
			'validation');
			
			return false;
		}//*/
		
		return true;
	}
```
_SESSION:
 [
    'session_id' => 'c6fc55hc0t84mhbfod0p9mv7ff'
    'session_token' => '0LYK1d4BmpA8wgEwR3dpjNzrYbJtYDqV6DzvngDu3JLgVYUixgDj0_CIEC-ueXcT'
    'user_ip' => '::1'
    'user_agent' => 'Mozilla/5.0 ...'
    'extra_data' => []
    'cart_data' => [
        0 => [
            'id' => 1
            'quantity' => 1
        ]
    ]
    'expires_at' => 1753477591
]

I dont understand the error.