HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /An online bookshop uses two cookies. Cookie A holds the books in the shopping basket while the user…
HardComputer ScienceHigh School (9–10)Computer Science › The Internet, the Web and Digital CurrencyConceptualIGCSE

An online bookshop uses two cookies. Cookie A holds the books in the shopping basket while the user…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

An online bookshop uses two cookies.

  • Cookie A holds the books in the shopping basket while the user goes on looking.
  • Cookie B keeps the user logged in for two weeks, so the user does not type the password each visit.
  1. Which cookie should be a session cookie and which a persistent cookie? Explain.
  1. A user shares a computer in a library. Explain why cookie B is a risk there.
  1. Explain why the bookshop asks the user before it stores some cookies.
Need a reminder? The key ideaShowHide

The browser sends the domain name to a domain name server (DNS). The DNS returns the IP address (asking another DNS if it does not know the name). The browser sends a request to the web server at that address, the server sends the page as HTML, and the browser renders it. A cookie is a small text file that a website stores on the device through the browser: a session cookie is deleted when the browser closes, a persistent cookie stays until its expiry date or until it is deleted.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

(a) Cookie A can be a session cookie: the basket is needed only during this visit, and the cookie goes when the browser closes. Cookie B must be a persistent cookie: it has to stay after the browser is closed, for two weeks.

(b) Cookie B stays on the library computer after the user leaves. The next person to open the bookshop could be logged in as that user. They could see the user's details or order books with the account. On a shared computer, the user should log out or delete the cookies.

(c) Cookies can store personal details and track which pages a user visits. Users have a right to choose whether that data is kept, so websites ask before they store cookies that are not needed for the site to work.

Remember. Cookies are small text files. They are not programs and cannot run, but the data in them can be personal.

Log in to save this for later
← All Problems
← A weather website stores a persistent cookie that remembers a user's home town…Leo keeps a digital currency in a digital wallet… →
More onComputer Science › The Internet, the Web and Digital Currency

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. Part of a blockchain holds these payments, oldest first…Hard
  2. A blockchain has 56 blocks. A new block is added to the honest chain every 10 minutes…Hard
  3. Kemal pays Dana 9 units of a digital currency that uses a blockchain…Medium
  4. A blockchain is copied on 40 computers in a network…Medium
  5. A student designs a "blockchain" in which each block holds only its data, a time-stamp and its own…Hard
All problems on this topic →