SELECT
  'cookie' AS component,
  'session' AS name,
  sqlpage.random_string(32) AS value
WHERE sqlpage.cookie('session') IS NULL
;

SELECT
  'cookie' AS component,
  'products' AS name,
  $products AS value
WHERE $products IS NOT NULL
;
SELECT
  'cookie' AS component,
  'products' AS name,
  $products AS value,
  TRUE AS remove
WHERE $products IS NULL
;
SELECT
  'cookie' AS component,
  'categories' AS name,
  $categories AS value
WHERE $categories IS NOT NULL
;
SELECT
  'cookie' AS component,
  'categories' AS name,
  $categories AS value,
  TRUE AS remove
WHERE $categories IS NULL
;
SELECT
  'cookie' AS component,
  'groups' AS name,
  $groups AS value
WHERE $groups IS NOT NULL
;
SELECT
  'cookie' AS component,
  'groups' AS name,
  $groups AS value,
  TRUE AS remove
WHERE $groups IS NULL
;
