Remembering information across different pages with JavaScript Cookies Example 2- Page 1

Remember 2 cookies across 3 pages: Remember several pages later what username you entered and _which_ image you clicked on the first page - 30 and 20 second expiry

1

2


Cookie remembering the user's name is named "theusersname" and expires in 30 seconds.
Cookie remembering which image was clicked last is named "whichimg" and expires in 20 seconds.

No cookies are checked when the page loads in this example.
If you mousedown on the image with the id numberimg1, the string "one" is saved as the content of the cookie (which expires in 20 seconds). But if you mousedown on the image with the id numberimg2, the string "two" is saved as the content of the cookie.
Then the page redirects to the next page.