Class example Nov. 27, 2013, setting and using a cookie. I have chosen to set pname using php, or jname using javascript, in the two examples. I also did not set a long expiry time, since this is just an example.

This page has set the cookie jname, using Javascript.
I have chosen to let it expire when you close your browser. To set an expiry time is more complicated in Javascript, there are examples on the web.
This could also be done using PHP

Code for this page

Use CTRL-U to view source
Back to Web Design on Osiris