How To Keep Your Website’s Cookies From Going Stale

Stale Cookies

Cookies are an aspect of the web that has caused more discussion and confusion than anyone ever imagined. Those tiny bits of data that websites store on computers are used to track people as they move about the web and to identify people when they return to a site. However, recently some web cookies have been going stale and disappearing, but we can take steps to keep them fresh.

Cookies have helped us overcome one of the limitations of the web – not being able to easily identify a series of pages as being part of a single user session. With some ISPs changing Internet addresses (the IP address) during a single user session, cookies help a website to know that the items placed in the shopping cart a few pages back all belong to the same customer.

There are many other ways to use cookies to track users. They can recognize, for instance, when a person returns to a site, which allows the web server to look up an individual profile record without the user’s having to remember an ID and password.

However, when a number of sites that I frequent stopped recognizing me recently, I started wondering if I did something that gave some personalized websites amnesia. After all, on several sites, I had specifically checked the box next to “Remember me, so I don’t need to log on.” But they didn’t.

That’s when I started digging into my cookies.

When Good Cookies Go Bad

I started by looking at the lines of information in the cookies.txt file where Netscape keeps its cookies. The file had hundreds of cookies from sites I had visited recently but was missing several sites that I visit infrequently. Then I checked the folder where Microsoft Internet Explorer keeps its cookies, and I found only a modest number.

It was clear that my batch of good cookies had, indeed, gone bad.

There are two main reasons why cookies disappear, but web managers have control over only one of them.

Cookies contain an expiration date that tells the browser software when to delete the cookie.

Cookies without an expiration date last only until the user quits out of their browser software, so developers normally use a distant date when developing web software.

Several years ago when developers started using cookies, it was common to use the example on the Netscape site as a guide. After all, Netscape invented cookies, so why not go to the source for a good cookie to use as a pattern?

Unfortunately for us now, the date used on the Netscape site is November 9, 1999, so any fixed cookie that used that date had now expired and been deleted by browsers.

The other problem is one that is harder for web marketers to manage, which is the maximum number of cookies that browser software will store. Netscape’s browsers, for example, keep only 300 cookies on file. As more cookies are received from sites, the oldest cookies get shoved out of the cookie jar no matter their expiration date.

Microsoft’s Internet Explorer has a different approach for determining how many cookies to keep. It normally uses up to two percent of a disk drive for cookies, which with today’s larger disk drives means it’s harder for users of MSIE to hit the maximum number of cookies.

Got Milk?

Keeping cookies updated is not a problem for the large banner ad companies that serve ads on many sites, but individual content and commerce sites face the challenge of keeping people coming back.

The traditional approach is to have editorial content or a software application that is so compelling that people return to the site without being reminded. A small number of sites account for an overwhelming majority of visits, so it’s clear that it takes more than compelling content to attract people back to a site.

E-mail newsletters have become popular as a way to pull people back to a website. It’s likely that you are reading this as a result of receiving the daily DLANDROID24 e-mail containing links back to the website. Once readers are back on your site, their cookie can be updated so the browser will keep it around a while longer.