This file contains JavaScript that creates a transient cookie, creates a permanent cookie, deletes a cookie, and extracts the value from a cookie.

Step 1 - Create a folder named cookie, and create a file within it to Display Initial Value of Cookie. Initially we display the value of the cookie when the page is loaded.
Value of Cookie When Page is Loaded =

Step 2 -- Create some cookies from user input on a form and display them; note how when you refresh the browser, the cookies are now there when the page is loaded; demonstrate they are transient by closing the browser and then opening the page again. 
Name:
Title:

Step 3 - Setting a persistent cookie; i.e. one that will exist after the browser is closed.
Course:
School:

Step 4 - Deleting a cookie by setting the expiration date to a past date. You need to use the cookie name and the equal sign, with or without a value.
Cookie name:

Step 5 - Create another page in the same directory, and show how the cookie is available in that web page. Create another page outside of the same directory, and show how the cookie is not available in that web page. Then set the path in the initial file so as to make it available in this other page.
Major: Path:

Step 6 - Now we will access the value of a particular item in the cookie using the function with split

Now we will access the value of a particular item in the cookie using the function with indexOf and substring

Modified: March 18, 2002