Overview

Introduction

Welcome to the Creating Cookies Practice Lab. In this module you will be provided with the instructions and devices needed to develop your hands-on skills.

Learning Outcomes

In this module, you will complete the following exercise:

  • Exercise 1 - Creating and Reading Cookies

After completing this lab, you will be able to:

  • Set a cookie for users
  • Read the values stored in a cookie

Exam Objectives

The following exam objective is covered in this lab:

  • 1.5 Complete and debug code that interacts with the Browser Object Model (BOM)

Lab Duration

It will take approximately 20 minutes to complete this lab.

Exercise 1 - Creating and Reading Cookies

When you access a website, a connection is made between your computer and the web server. The URL you typed is sent as a request to the web server. The web server, in turn, returns the website you requested, and then the connection between the server and your computer is closed. The server does not have memory to store information such as who you are or any settings/preferences that you would have specified on the web page.

Cookies are used to help the Web server remember you and your specified preferences. Cookies are small text files that store your information on your computer’s hard disk when you visit a website for the first time. At subsequent visits to the same website, the data stored in this file is used to personalize the website for you.

In this exercise, you will learn how to write and read cookies to personalize your website for the users. In the first task, you will download the Visual Studio Code workspace from the Intranet and open the ToDoList workspace.

In the second task, you will write JavaScript code to create and retrieve cookies.

In the third task, you will install the Internet Information Services (IIS) on your computer to host the ToDoList.html page and view the effect of cookies in your browser.

Comprehensive Learning

See the full benefits of our immersive learning experience with interactive courses and guided career paths.