Example #2 in the use of cookies.
Download the Script
Reload
to see the counter working or
reset
your cookie's name.