Cookies: Storing and Passing Information

On their own, HTML and CSS are unable to store user information, so once the Web browser is closed, any user information is lost. Cookies, Web storage, and sessions are workarounds for this shortcoming. Research and describe some tips for someone new to JavaScript to get begin to work with user information storage. In particular, focus on at least two of the following points while providing sample code (with comments) of each:

  • Identify which storage situations would be best resolved with sessions, local storage, and cookies to store persistent data.
  • Distinguish among session storage, local storage, and cookies.
  • Describe how to create, read, and delete cookies with the document.cookie property.
  • Explain how to parse a cookie string.
  • Describe the visibility, scope, and lifetime of a cookie.
  • Explain how cookies can create a customized user experience.


Learning Components

This activity will help you achieve the following learning components:

  • Examine how to store, retrieve, and pass data through query strings.
  • Understand how to store data and retrieve data from cookies.
  • Examine how to dynamically store data into hidden input fields.

View examples of effective JavaScript comments that describe and explain variables and functions.

Do My paper price
Pages (550 words)
Approximate price: -