0% found this document useful (0 votes)
6 views2 pages

Reymond Gregorio - Task Quiz (LocalStorageVSSessionStorage) - 1

Uploaded by

vimvimtae96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Reymond Gregorio - Task Quiz (LocalStorageVSSessionStorage) - 1

Uploaded by

vimvimtae96
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Name: Reymond C Gregorio Blk: 4

Task Instructions

Part 1: Testing localStorage Version

1. Open webStorage(localStorage)/login.html in your browser

2. Enter any username and password

3. Click "Submit" - you should be redirected to home.html

4. Close the entire browser (all windows/tabs)

5. Reopen webStorage(localStorage)/home.html directly

Observation:

As I observed I can't enter any username and password in local storage but when i click the logout I
directly go on session storage

Part 2: Testing sessionStorage Version

1. Open webStorage(SessionStorage)/login.html in your browser

2. Enter any username and password

3. Click "Submit" - you should be redirected to home.html

4. Close only this tab (not the entire browser)

5. Reopen webStorage(SessionStorage)/home.html directly

Observation:

As I observed if you click the submit it didn't redirected go to home.html.


Part 3: Code Analysis

Examine the code differences between both versions:

1. Storage Mechanism Difference:

o localStorage -- stores data with no expiration date, manually removed.

o sessionStorage -- stores data for a session, automatically removed when session ends
(tab/browser close).

2. Persistence Difference:

o localStorage -- persists even after browser restart.

o sessionStorage -- data lost when session ends (tab/browser close).

3. Scope Difference:

o localStorage -- shared across tabs/windows from the same origin


(domain/protocol/port).

o sessionStorage -- limited to the tab/window where it was set.

Questions for Understanding

1. What happens if you open home.html in a new tab without closing the original tab in the
sessionStorage version? The both tab is the same open and when I click the logout in local
storage I directly go on session storage

2. What security considerations should you keep in mind when using web storage for
authentication? Avoid storing sensitive information like passwords or personal data in plain
texts.

You might also like