logo

Cambridge IGCSE Computer Science revision notes

The internet and the world wide web Revision Notes

Cambridge IGCSE revision notes for The internet and the world wide web.

At a glance

revision notes

Resource type

Topic

The internet and the world wide web

CambridgeIGCSEComputer ScienceThe internet and its uses

Complete revision guide 1 of 6

Distinguishing the Internet from the World Wide Web

This note explains the fundamental difference between the internet and the World Wide Web (WWW), highlighting the internet as the global infrastructure enabling data exchange and the WWW as a service consisting of websites and web pages accessed through this infrastructure.

Syllabus source

Section 3, Topic 5.1, page 21, objective 5.1.1

Open source document ↗

What you should be able to do

  • ✓Understand the internet as a global network infrastructure connecting computers and devices.
  • ✓Recognize the World Wide Web as a collection of websites and web pages accessible via the internet.
  • ✓Explain how the internet supports multiple services including but not limited to the World Wide Web.
  • ✓Identify the role of web browsers in accessing the World Wide Web.
  • ✓Distinguish clearly between the physical network (internet) and the content/service layer (World Wide Web).
1

The Internet: The Global Network Infrastructure

The internet is a vast, worldwide system of interconnected computers and other devices linked by physical and wireless connections. It uses standard communication protocols to enable data exchange between these devices regardless of their location. This infrastructure includes hardware such as routers, servers, cables, satellites, and data centres, as well as software protocols that manage data transmission.

For example, when you send an email or stream a video, your device communicates over the internet's infrastructure to reach the destination server or service.

The internet is not a single entity but a network of networks, allowing diverse devices to communicate seamlessly. It supports many services beyond the World Wide Web, such as email, file transfer, and online gaming.

  • Composed of interconnected hardware and protocols.
  • Enables data transmission globally.
  • Supports multiple services, not just web browsing.
2

The World Wide Web: A Service Operating Over the Internet

The World Wide Web (WWW) is a system of interlinked hypertext documents and multimedia content accessed through the internet. It consists of websites made up of web pages written primarily in Hypertext Markup Language (HTML).

Users access the WWW using web browsers, which retrieve web pages from web servers via the internet and display them on devices. The WWW is just one of many services that run on the internet's infrastructure.

For instance, when you type a website address into a browser, the browser requests the corresponding web page from a server over the internet, then renders the page for you to view and interact with.

  • Collection of websites and web pages.
  • Accessed using web browsers.
  • Operates as a service on top of the internet infrastructure.
3

How the Internet and the World Wide Web Work Together

The internet provides the physical and logical pathways that allow data to travel between devices worldwide. The World Wide Web uses these pathways to deliver web content to users.

Think of the internet as a system of roads and highways, while the World Wide Web is like the collection of shops and information centres located along those roads. Without the roads (internet), you cannot reach the shops (websites).

This relationship means that the WWW depends on the internet to function, but the internet itself supports many other services independently of the WWW.

  • Internet is the underlying network; WWW is a service on it.
  • WWW content travels over the internet's infrastructure.
  • Internet supports other services besides the WWW.
4

Role of Web Browsers in Accessing the World Wide Web

Web browsers are software applications that allow users to access and interact with the World Wide Web. They send requests for web pages to web servers via the internet and display the received content.

Browsers interpret HTML, CSS, and JavaScript to render web pages visually and functionally. Examples include Google Chrome, Mozilla Firefox, and Microsoft Edge.

Without a web browser, users cannot easily navigate the WWW, even though the internet connection exists.

  • Software to access and display web pages.
  • Communicates with web servers over the internet.
  • Interprets web languages to render content.
5

Summary of Key Differences

Understanding the distinction between the internet and the World Wide Web is essential for grasping how online communication and information access work.

The internet is the physical and logical network infrastructure enabling data exchange globally.

The World Wide Web is a service consisting of websites and web pages accessed via the internet using web browsers.

  • Internet = infrastructure (hardware + protocols).
  • World Wide Web = collection of web content accessed via the internet.
  • Web browsers enable user interaction with the WWW.

At-a-glance summary

Comparison table

AspectInternetWorld Wide WebExample
DefinitionGlobal network of interconnected computers and devicesSystem of interlinked web pages and websites accessed via the internetInternet connects devices worldwide; WWW is a website like www.example.com
FunctionProvides infrastructure for data transmissionDelivers web content and services to usersInternet routes data packets; WWW displays web pages
ComponentsRouters, servers, cables, protocols (e.g., TCP/IP)Websites, web pages, HTML documentsInternet includes physical cables; WWW includes HTML pages
Access MethodMultiple protocols (email, FTP, HTTP, etc.)Accessed specifically via HTTP/HTTPS protocols using browsersInternet supports email and web browsing; WWW accessed via browsers

Active recall

Quick check

1. What is the internet in relation to the World Wide Web?

The internet is the global network infrastructure that enables data exchange, while the World Wide Web is a service consisting of websites and web pages accessed via the internet.

2. Name one service other than the World Wide Web that uses the internet.

Email is an example of a service that uses the internet but is not part of the World Wide Web.

3. What role does a web browser play in accessing the World Wide Web?

A web browser requests web pages from servers over the internet and renders them for the user to view and interact with.

Complete revision guide 2 of 6

Understanding Uniform Resource Locators (URLs)

A Uniform Resource Locator (URL) is a structured text address used to locate and access specific web pages or files on the internet. It includes key components such as the protocol, domain name, and path, each serving a distinct role in directing web browsers to the correct resource.

Syllabus source

Section 3, Topic 5.1, page 21, objective 5.1.2

Open source document ↗

What you should be able to do

  • ✓Identify and explain the components of a URL.
  • ✓Understand the role of the protocol in a URL.
  • ✓Recognise how the domain name specifies the website location.
  • ✓Explain how the path directs to a specific web page or file within a website.
1

What is a URL?

A Uniform Resource Locator (URL) is a text-based address that specifies the location of a resource on the internet, most commonly a web page. It acts like a postal address for websites, allowing web browsers to find and retrieve the desired content.

Every URL is designed to be unique so that it points to exactly one resource, such as a web page, image, or document. Without URLs, it would be impossible to navigate the vast collection of information on the World Wide Web efficiently.

  • URLs are human-readable addresses for internet resources.
  • They enable browsers to locate and display web content.
  • Each URL corresponds to a unique resource.
2

Components of a URL

A URL is made up of several parts, each providing specific information needed to access a resource. The main components are: the protocol, the domain name, and the path.

1. Protocol: This indicates the method used to access the resource. Common protocols include HTTP (Hypertext Transfer Protocol) and HTTPS (HTTP Secure).

2. Domain Name: This identifies the website's address on the internet, such as www.example.com. It is linked to an IP address through the Domain Name System (DNS). The domain name helps browsers find the correct server hosting the website's content.

  • Protocol specifies how data is transferred (e.g., HTTP, HTTPS).
  • Domain name identifies the website location (e.g., www.example.com).
  • Path points to a specific page or file within the website.
3

The Protocol in Detail

The protocol part of a URL tells the browser how to communicate with the web server. HTTP is the standard protocol for transferring web pages, but HTTPS adds encryption for security, protecting data from interception.

For example, a URL starting with 'http://' uses the standard protocol, while one starting with 'https://' uses a secure connection. This distinction is important for sensitive transactions like online banking or shopping.

  • HTTP is the basic protocol for web communication.
  • HTTPS encrypts data for secure communication.
  • The protocol is always followed by '://'.
4

Domain Name and Its Role

The domain name is the human-friendly address of a website. It replaces the numerical IP address, which is harder to remember. For example, 'www.example.com' is easier to recall than '192.0.2.1'.

When a URL is entered, the browser uses the DNS to translate the domain name into the corresponding IP address, allowing it to connect to the correct server.

  • Domain names are easier to remember than IP addresses.
  • DNS translates domain names to IP addresses.
  • Domain names often include subdomains like 'www'.
5

The Path to a Specific Resource

After the domain name, the URL may include a path that specifies the exact location of a web page or file on the server. This path often looks like a file directory structure, for example, '/folder/page.html'.

If no path is specified, the browser usually loads the website's default homepage.

Paths can also include parameters or anchors to direct the browser to specific content within a page.

  • Path directs to a specific page or file (e.g., '/index.html').
  • It follows the domain name, separated by a slash '/'.
  • Paths can include folders and filenames.

At-a-glance summary

Comparison table

StepDetailExampleExam Use
Identify protocolSpecifies communication methodhttps://Explain secure vs standard protocols
Recognise domain nameWebsite address used by DNSwww.example.comDescribe domain name role in locating server
Understand pathLocation of specific resource/page1.htmlExplain how path directs to exact file
Combine componentsForm full URLhttps://www.example.com/page1.htmlAnalyse URL structure in questions

Active recall

Quick check

1. What does the protocol part of a URL specify?

It specifies the method used to access the resource, such as HTTP or HTTPS.

2. What role does the domain name play in a URL?

It identifies the website's address and is used by DNS to find the server's IP address.

3. What information does the path in a URL provide?

It specifies the exact location of a web page or file within the website.

4. Give an example of a full URL and identify its components.

https://www.example.com/index.html — 'https' is the protocol, 'www.example.com' is the domain name, and '/index.html' is the path.

Complete revision guide 3 of 6

Understanding HTTP and HTTPS: Function and Purpose

This note explains the roles of HTTP and HTTPS protocols in web communication, detailing how they enable data transfer between web browsers and servers, and highlighting the importance of HTTPS for secure online interactions.

Syllabus source

Section 3, Topic 5.1, page 21, objective 5.1.3

Open source document ↗

What you should be able to do

  • ✓Explain what HTTP is and how it facilitates communication on the World Wide Web.
  • ✓Describe the purpose of HTTPS and how it enhances security compared to HTTP.
  • ✓Understand the differences between HTTP and HTTPS in terms of data transmission and security.
  • ✓Recognise typical scenarios where HTTPS is essential for protecting user data.
1

What is HTTP?

HTTP stands for Hypertext Transfer Protocol. It is the primary protocol used for transmitting data on the World Wide Web. HTTP defines the rules and conventions for how messages are formatted and exchanged between a web browser (client) and a web server.

When you enter a website address in your browser, HTTP governs the request sent to the server and the response returned, which usually includes the web page content coded in HTML.

For example, when you type http://example.com in your browser, the browser sends an HTTP request to the server hosting example.com, which then replies with the requested web page data.

  • HTTP is an application-layer protocol used for communication between clients and servers.
  • It uses a request-response model: the client sends a request, the server sends back a response.
  • Data sent over HTTP is unencrypted and transmitted in plain text.
2

Limitations of HTTP

Because HTTP transmits data without encryption, any information sent between the browser and server can potentially be intercepted and read by third parties. This is a significant security risk when sensitive data such as passwords, credit card numbers, or personal details are involved.

For example, if you log into a website using HTTP, your username and password travel across the network in plain text, making it vulnerable to eavesdropping or man-in-the-middle attacks.

  • HTTP does not provide confidentiality or data integrity.
  • Data can be intercepted, modified, or stolen during transmission.
  • Not suitable for transmitting sensitive or private information.
3

What is HTTPS?

HTTPS stands for Hypertext Transfer Protocol Secure. It is an extension of HTTP that adds a layer of security by encrypting the data exchanged between the browser and the server.

HTTPS uses protocols such as SSL (Secure Sockets Layer) or TLS (Transport Layer Security) to create a secure, encrypted connection. This ensures that data cannot be read or altered by unauthorized parties during transmission.

For example, when you visit https://bank.com, your browser and the bank's server establish an encrypted connection before any data is exchanged, protecting your login credentials and financial information.

  • HTTPS encrypts data to protect confidentiality and integrity.
  • It uses SSL/TLS protocols to establish a secure connection.
  • Prevents eavesdropping and tampering with data during transmission.
4

How HTTPS Works in Practice

When a browser connects to a website using HTTPS, the server presents a digital certificate issued by a trusted authority. This certificate verifies the server's identity and enables the browser to initiate encrypted communication.

The encryption process involves exchanging keys and establishing a secure channel before any actual data is sent.

For example, when accessing an online store, HTTPS ensures that your payment details are encrypted and safe from interception.

  • Digital certificates authenticate the server's identity.
  • Encryption keys are exchanged to create a secure session.
  • All data sent over HTTPS is encrypted until the session ends.
5

When to Use HTTP vs HTTPS

HTTP may be sufficient for websites that only provide publicly available information without requiring user input, such as blogs or news sites.

However, HTTPS is essential whenever sensitive data is involved, including online banking, shopping, email services, and any site requiring login credentials.

Modern browsers often warn users when a site uses HTTP instead of HTTPS, indicating potential security risks.

  • Use HTTP for non-sensitive, public information.
  • Use HTTPS for any site handling personal or financial data.
  • HTTPS is now the standard for most websites due to security and privacy concerns.

At-a-glance summary

Comparison table

AspectHTTPHTTPSExample Use
SecurityNo encryption; data sent in plain textData encrypted using SSL/TLS protocolsBrowsing a public news website
Data IntegrityNo protection; data can be alteredEnsures data is not tampered with during transmissionOnline banking transactions
AuthenticationNo verification of server identityUses digital certificates to verify serverLogging into email accounts
URL Prefixhttp://https://Accessing an e-commerce site

Active recall

Quick check

1. What does HTTP stand for and what is its main function?

HTTP stands for Hypertext Transfer Protocol; it defines how web browsers and servers communicate to transfer web pages.

2. How does HTTPS differ from HTTP?

HTTPS encrypts data using SSL/TLS to secure communication, while HTTP sends data unencrypted.

3. Why is HTTPS important for online banking?

Because it encrypts sensitive data like passwords and account details, preventing interception and tampering.

4. What indicates that a website is using HTTPS in its URL?

The URL begins with 'https://' instead of 'http://'.

Complete revision guide 4 of 6

Purpose and Functionalities of a Web Browser

A web browser is a software application that retrieves, interprets, and displays web pages by rendering HTML. It provides essential features such as bookmarking, history tracking, tab management, cookie storage, navigation tools, and an address bar to facilitate efficient and user-friendly web browsing.

Syllabus source

Section 3, Topic 5.1, page 21, objective 5.1.4

Open source document ↗

What you should be able to do

  • ✓Understand the primary role of a web browser in accessing and displaying web content.
  • ✓Identify and explain key features of web browsers including bookmarking, history, tabs, cookies, navigation tools, and the address bar.
  • ✓Explain how these features enhance user experience and web navigation.
1

Role of a Web Browser

A web browser is a specialised software application designed to access the World Wide Web. Its main function is to retrieve web pages from web servers and display them to the user. The content of web pages is primarily written in Hypertext Markup Language (HTML), which browsers interpret and render visually. Without a browser, users would not be able to view or interact with websites effectively.

When a user enters a web address (URL) or clicks a link, the browser sends a request to the appropriate web server, receives the HTML content, and processes it to present formatted text, images, videos, and interactive elements on the screen. This process involves parsing HTML code, applying styles, and executing scripts if present.

  • Browsers interpret HTML to display web pages.
  • They act as the interface between users and web content.
  • They communicate with web servers to fetch requested pages.
2

Bookmarking and History Features

Bookmarking allows users to save the URLs of their favourite or frequently visited websites for quick access later. Instead of typing the full address again, users can select a bookmark to open the page immediately. This feature improves efficiency and organisation when browsing.

History tracking records the list of web pages visited during browsing sessions. This chronological log enables users to revisit previously viewed pages without needing to remember or re-enter URLs. Browsers often provide search functions within history to find specific pages.

For example, if a student frequently visits an online dictionary, bookmarking it saves time, while history helps find a useful article viewed earlier in the week.

  • Bookmarks store favourite website addresses for quick access.
  • History logs previously visited pages in order.
  • Both features save time and improve navigation.
3

Tab Management

Modern browsers support tabbed browsing, allowing multiple web pages to be open simultaneously within a single window. Each tab acts like an independent page, enabling users to switch between different sites without opening multiple browser windows.

This feature enhances multitasking and organisation. For instance, a user researching a topic can keep several relevant pages open in separate tabs and compare information easily.

Tabs can be opened, closed, rearranged, and sometimes grouped, providing flexible control over browsing sessions.

  • Tabs allow multiple pages in one window.
  • They facilitate multitasking and comparison of information.
  • Users can manage tabs by opening, closing, or rearranging them.
4

Cookie Storage and Management

Cookies are small pieces of data stored by the browser on the user's device at the request of websites. They serve various purposes such as saving login credentials, tracking user preferences, and maintaining session information like items in an online shopping cart.

Browsers manage cookies by storing them securely and sending relevant cookies back to the server when revisiting the site. This enables personalised and seamless user experiences.

For example, an online store uses cookies to remember the products a user has added to their cart, so they remain there even if the user navigates away and returns later.

  • Cookies store small data pieces for websites.
  • They help remember user preferences and sessions.
  • Browsers manage cookies to enable personalised browsing.
5

Navigation Tools and Address Bar

Navigation tools in browsers include back and forward buttons, refresh/reload, and home buttons. These allow users to move through their browsing history, reload pages to see updated content, or return to a default start page.

The address bar is a key component where users enter URLs or search queries. It displays the current page's web address and often integrates search engine functionality, allowing direct searches without visiting a search engine website first.

For example, typing 'www.example.com' in the address bar loads that website, while typing a keyword may trigger a search results page. Navigation buttons help users retrace steps or update content as needed.

  • Navigation tools include back, forward, refresh, and home buttons.
  • The address bar is used to enter URLs or search terms.
  • These tools improve control and ease of browsing.

At-a-glance summary

Comparison table

FeaturePurposeExampleExam Use
BookmarkingSave favourite URLs for quick accessSaving a news site to bookmarksExplain how bookmarking saves time
HistoryRecord visited pages chronologicallyFinding a previously read articleDescribe how history aids navigation
TabsOpen multiple pages in one windowResearching several topics simultaneouslyExplain benefits of tab management
CookiesStore user data for sessions and preferencesRemembering login details on a shopping siteDescribe cookie role in personalisation
Navigation toolsMove through browsing history and refresh pagesUsing back button to revisit a pageExplain function of back and forward buttons
Address barEnter URLs or search queriesTyping 'www.example.com' to visit a siteDescribe the use of the address bar

Active recall

Quick check

1. What is the main role of a web browser?

To retrieve web pages from servers and render the HTML content so users can view and interact with websites.

2. How does bookmarking improve browsing?

It saves URLs of favourite sites so users can quickly access them without typing the address again.

3. What is the purpose of cookies stored by a browser?

To save user data like login details and preferences, enabling personalised and continuous sessions.

4. Name two navigation tools in a browser and their functions.

Back button to return to the previous page and refresh button to reload the current page.

Complete revision guide 5 of 6

Process of Finding, Retrieving, and Displaying Web Pages from a URL

This note explains the detailed process that occurs when a user enters a URL into a web browser, covering the roles of the web browser, IP addresses, domain name server (DNS), web server, and HTML in locating, retrieving, and displaying a web page.

Syllabus source

Section 3, Topic 5.1, page 22, objective 5.1.5

Open source document ↗

What you should be able to do

  • ✓Understand how a URL is used to locate a web page on the internet.
  • ✓Explain the role of the Domain Name Server (DNS) in translating domain names to IP addresses.
  • ✓Describe how a web browser requests and receives web pages from a web server.
  • ✓Understand how HTML is used by the browser to display web pages.
  • ✓Recognise the sequence of steps involved in web page retrieval and rendering.
1

Entering a URL and Initial Browser Actions

When a user types a URL (Uniform Resource Locator) into the web browser's address bar and presses enter, the browser begins the process of locating the requested web page. The URL typically includes the protocol (such as http or https), the domain name (like www.example.com), and optionally a specific page or file path.

Before sending any requests over the internet, the browser checks its cache — a local storage of recently accessed web pages — to see if the page is already saved. If the page is found and still valid, it can be displayed immediately without further network activity. If not, the browser proceeds to find the server hosting the page.

  • URL includes protocol, domain, and page path
  • Browser checks cache for stored page
  • If not cached, browser initiates domain resolution
2

Domain Name Server (DNS) and IP Address Resolution

Computers on the internet communicate using IP addresses, which are numerical labels assigned to each device. However, humans use domain names because they are easier to remember. The Domain Name Server (DNS) acts like a phone book, translating the domain name in the URL into the corresponding IP address of the web server hosting the website.

The browser sends a DNS query to a DNS server, which looks up the domain name and returns the IP address. For example, the domain www.example.com might resolve to 93.184.216.34. This IP address is essential for routing the request across the internet to the correct server.

  • DNS translates domain names to IP addresses
  • Browser sends DNS query to find IP
  • IP address identifies the web server location
3

Sending the HTTP Request to the Web Server

Once the browser has the IP address, it establishes a connection to the web server using the Hypertext Transfer Protocol (HTTP) or its secure version HTTPS. The browser sends an HTTP request message asking for the specific web page or resource indicated in the URL.

This request includes details such as the method (usually GET to retrieve data), the path of the resource, and headers that provide additional information like the browser type or accepted languages. The web server listens for such requests on a specific port (usually port 80 for HTTP or 443 for HTTPS).

  • Browser sends HTTP GET request to web server IP
  • Request specifies the desired page or resource
  • Connection uses HTTP or HTTPS protocols
4

Web Server Processing and Response

The web server receives the HTTP request and processes it. It locates the requested HTML file or resource on its storage. If the file exists and the request is valid, the server sends back an HTTP response containing the HTML content of the web page along with status codes (e.g., 200 OK).

If the page is not found, the server returns an error code such as 404 Not Found. The server may also send additional resources like images, CSS files, or scripts referenced by the HTML page, either immediately or as the browser requests them later.

  • Server locates requested HTML page
  • Sends HTTP response with HTML content
  • Includes status codes indicating success or errors
5

Rendering the Web Page Using HTML

After receiving the HTML content, the browser parses the HTML code to construct the Document Object Model (DOM), which represents the structure of the web page. The browser then applies styles, executes scripts, and loads additional resources to render the page visually on the user's device.

This rendering process converts the raw HTML text into formatted text, images, links, and interactive elements that the user can see and interact with. The browser manages this process efficiently to display the page as quickly as possible.

  • Browser parses HTML to build page structure
  • Applies styles and executes scripts
  • Displays the fully rendered web page to the user

At-a-glance summary

Comparison table

StepDetailExampleExam Use
URL EntryUser inputs the web address into the browserTyping 'https://www.bbc.co.uk'Explain the starting point of web page retrieval
DNS ResolutionDomain name converted to IP address'www.bbc.co.uk' → '151.101.0.81'Describe the role of DNS in locating servers
HTTP RequestBrowser sends request to web server IPGET request for homepage HTMLOutline how the browser requests the page
Server ResponseServer sends back HTML contentServer returns HTML code for BBC homepageExplain how the server provides the page
RenderingBrowser displays the page using HTMLPage appears with text, images, and linksDescribe how HTML is used to show the page

Active recall

Quick check

1. What is the role of the DNS in retrieving a web page?

It translates the domain name in the URL into the IP address of the web server hosting the page.

2. After obtaining the IP address, what does the browser do next?

It sends an HTTP request to the web server at that IP address asking for the web page.

3. What does the web server send back to the browser?

The server sends the HTML content of the requested web page along with status information.

4. How does the browser display the web page to the user?

The browser parses and renders the HTML code to visually display the page with text, images, and links.

Complete revision guide 6 of 6

Understanding Cookies: Session and Persistent Types and Their Uses

Cookies are small data files stored by web browsers on user devices to enhance web interactions. They come in two main types: session cookies, which exist temporarily during a browsing session, and persistent cookies, which remain for longer periods. Cookies enable websites to remember user information, preferences, shopping cart contents, and login credentials, improving user experience and functionality.

Syllabus source

Section 3, Topic 5.1, page 22, objective 5.1.6

Open source document ↗

What you should be able to do

  • ✓Define what cookies are and their role in web browsing.
  • ✓Distinguish between session cookies and persistent cookies based on lifespan and purpose.
  • ✓Explain how cookies save personal information and track user preferences.
  • ✓Describe how cookies maintain items in online shopping carts.
  • ✓Explain the use of cookies in storing login credentials for websites.
1

What Are Cookies?

Cookies are small text files created by websites and stored on a user's device by the web browser. They contain data that helps websites remember information about the user and their interactions. This data is sent back to the website each time the user visits, allowing the site to provide a more personalised and efficient experience.

Cookies do not contain programs or viruses; they are simply data files. Their main purpose is to store information that would otherwise be lost when a user navigates away from a page or closes the browser.

  • Cookies are small data files stored on a user's device.
  • They help websites remember user information between visits.
  • Cookies are managed by the web browser.
2

Types of Cookies: Session vs Persistent

Cookies are mainly classified into two types based on their lifespan: session cookies and persistent cookies.

Session cookies exist only while the user’s browser is open. Once the browser is closed, these cookies are deleted automatically. They are used to keep track of temporary information during a single visit, such as items added to a shopping cart before checkout.

Persistent cookies remain on the user’s device after the browser is closed. They have an expiration date set by the website and can last from a few days to several years. These cookies remember information across multiple visits, such as login details or user preferences, so the user does not have to re-enter them each time they return.

  • Session cookies are temporary and deleted after the browser closes.
  • Persistent cookies remain until they expire or are deleted.
  • The lifespan determines how cookies are used by websites.
3

Saving Personal Information and Tracking Preferences

Cookies can store personal information that users provide, such as language preferences, theme choices, or form inputs. This allows websites to customise content automatically on subsequent visits without asking the user again.

For example, a website might remember that a user prefers to view content in Spanish or prefers a dark mode theme. This tracking of preferences improves usability and user satisfaction.

Cookies do not typically store sensitive data like passwords in plain text, but they can store tokens or identifiers linked to such information securely on the server side.

  • Cookies save user preferences like language or display settings.
  • They help personalise the browsing experience.
  • Sensitive data is usually protected and not stored directly in cookies.
4

Maintaining Items in an Online Shopping Cart

When shopping online, cookies help keep track of items added to a shopping cart as the user browses different pages. Session cookies are commonly used here to remember the cart contents during a single visit.

Without cookies, the website would not know which items the user selected when moving between pages, forcing the user to reselect items repeatedly.

Persistent cookies can also be used to remember cart contents between visits, allowing users to return later and find their cart unchanged.

  • Cookies track shopping cart contents during browsing.
  • Session cookies maintain cart data temporarily.
  • Persistent cookies can save cart contents for future visits.
5

Storing Login Credentials

Cookies can store login credentials or tokens that allow users to stay logged into websites without re-entering usernames and passwords each time.

Persistent cookies are typically used for this purpose, storing encrypted tokens that authenticate the user automatically on return visits.

This improves convenience but requires secure handling to prevent unauthorised access. Websites often provide options to remember login details using cookies or to log in manually each time for security reasons.

  • Cookies store login tokens to keep users signed in.
  • Persistent cookies enable automatic login on return visits.
  • Security measures protect login information stored in cookies.

At-a-glance summary

Comparison table

AspectSession CookiesPersistent CookiesExample Use
LifespanDeleted when browser closesRemain until expiration dateShopping cart contents during visit vs saved login
Storage LocationBrowser memory onlyStored on device's hard driveTemporary form data vs saved preferences
PurposeTrack temporary session dataRemember information across visitsKeeping user logged in vs language preference
Security RiskLower risk, short-livedHigher risk if stolen, longer lifespanTemporary cart vs saved login credentials

Active recall

Quick check

1. What happens to session cookies when the browser is closed?

They are deleted and no longer stored on the device.

2. How do persistent cookies improve user experience?

By remembering user information and preferences across multiple visits.

3. Give an example of how cookies maintain an online shopping cart.

Session cookies keep track of items added to the cart as the user browses different pages during one visit.

4. Why do websites use cookies to store login credentials?

To allow users to stay logged in without re-entering their username and password each time.

Revision hubs

Keep studying from the right hub