Choosing session or persistent cookies for a scenario
Decide how long a cookie must last: session if it can go when the browser closes, persistent if it must last for later visits. Justify your choice with because.
Understanding Choosing session or persistent cookies for a scenario in IGCSE Computer Science Paper 1
What it does: A shared computer is a risk, so the cookie must disappear as soon as the browser closes. That makes it a session cookie. With no Expires or Max-Age, the cookie only lasts for the visit. This suits a cart that is only used during one visit.
Common mistakes: Line 1 is wrong. A bank login on a shared computer needs a session cookie, so the next user cannot get into the account after the browser closes. Line 1 should be cookie ← "session". The setting must last for many visits, so the cookie must be persistent. A session cookie would be deleted when the browser closes and the language would be forgotten. Line 4 should be cookie ← "persistent".
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
session or persistentFill in the Blanks
Spot the Error
Student with a class code? Join your class →