Cookie use: holding items in an online shopping cart
A cookie that remembers which items a user has added to an online shopping cart, so the cart is not emptied as they move between pages. It can last one visit or be kept for later.
Understanding Cookie use: holding items in an online shopping cart in IGCSE Computer Science Paper 1
What it does: With no expiry time set, this is a session cookie. It holds the cart during one visit and is deleted when the browser closes. The whole point of a shopping cart cookie is that the cart survives moving from page to page. The cookie name and value hold the cart items, so the cart can be remembered as the user moves between pages.
Common mistakes: The cart must be stored in the cookie so it survives the move to the next page. Deleting it would empty the cart. It should be STORE cart IN cookie. Writing "empty" overwrites the cookie and loses the items. The updated cart, including the shoes, should be written back: WRITE cart TO cookie.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 490–499) and word search (Modules 490–509).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
shopping cart cookieFill in the Blanks
Spot the Error
Student with a class code? Join your class →