You Have Visited N Times
counters and guestbook 1997 still worksCounts how many times this particular visitor has been back, using a cookie.
In 2026: Works. It counts one person, not your traffic, so it always read higher than the real number: you reloaded your own page more than anyone.
Where it came from: Netscape persistent client state specification, 1994, plus every script archive after it. MDN ↗
<script language="JavaScript">
var n = 0;
try {
var m = document.cookie.match(/visits=(\d+)/);
if (m) n = parseInt(m[1], 10);
n++;
document.cookie = "visits=" + n + "; path=/; max-age=31536000";
} catch (e) {
n = 1; // a sandboxed demo frame has no cookie access, so show the first visit
}
document.write("You have visited this page <b>" + n + "</b> time"
+ (n === 1 ? "" : "s") + "!");
</script>