Assignment3 Instructions
Assignment3 Instructions
Assignment3 Instructions
cookie
In this assignment, you’ll develop an application that allows you to log in, save the
user data in a cookie, navigate to a new page, and log out.
The interface looks like this initially:
And the interface looks like this after you’ve logged in:
NOTE: When you run this application from the file system, it doesn’t work in the
Chrome browser, but it should work in the Firefox browser or use VS Code
Live Server extension.
1) Open the starter application(zipped) attached to this Assignment folder:
a) Evaluations\Assignments\Assignment 3\Part1-login.zip
b) Then, run the application to see the user interface shown above.
2) Review the code in the login.js file. Note that it contains starts for four functions:
getCookieByName(), setCookie(), deleteCookie(), and goToPage(). The
getCookieByName() function returns an empty string, while the others contain no
code.
3) Review the index.html file and notice that its embedded JavaScript code uses the
functions in the login.js file.
4) Review the login.html file and notice that its embedded JavaScript code uses the
functions in the login.js file.
5) In the login.js file, update each of the functions so they perform the tasks
described by their names. Use the examples in figures 14-5 through 14-7 as a
guide for the first three, and figure 14-1 for the last one.
6) In index.html, change the text in the <small> tag to your name and student
number.
7) Run the application, enter a user name, and click Log In. When the login.html
page displays, press F12 to open the developer tools and display the Storage
panel (in FireFox) to view the cookies for this application. This should show the
cookie for this application.
Assignment 3-2 Instructions: Navigate between pages and use
session storage
In this assignment, you’ll enhance the Account Profile application to save its data in
session storage, navigate to a new page, and allow you to navigate back to the
original page. When you click on the Save button, a new page gets the data from
session storage and displays it like this: