Cambridge O Level Computer Science · Syllabus 2210 · The Internet and its Uses
Session Cookie
What is Session Cookie?
A session cookie is a cookie that has no expiry date set and is normally held only while the browsing session lasts, being deleted when the browser or session is closed; it is used for tasks such as keeping a user logged in during a visit or holding items in an online shopping cart.
This definition is part of the The Internet and its Uses chapter in Cambridge O Level Computer Science.
Session Cookie in context
A cookie is a small piece of data that a website sends to the browser, which the browser stores and then sends back to that same website on later requests. Cookies let a site recognise the same browser again, which is how it can keep a user logged in, remember a shopping cart, save personal details, and store preferences. A session cookie is normally kept only until the browsing session ends; a persistent cookie is stored on the device until its expiry date is reached or the user deletes it. A cookie is data, not a program — it cannot run and it is not a virus — but because it can carry an identifier that follows a user around, it raises real privacy concerns.
Questions students ask about Session Cookie
What is the difference between a session cookie and a persistent cookie?
A session cookie has no expiry date set and is normally held only while the browsing session lasts, being deleted when the browser or session closes; it is used for tasks such as keeping a user logged in or holding items in a shopping cart during one visit. A persistent cookie is stored on the device with an expiry date and remains until that date is reached or the user deletes it, so it is returned to the site on future visits, which is how sites remember saved details or preferences.

