We're trying to figure out how common web tracking software works, like Google Analytics.
We've noticed that much tracking Javascript code from around the web creates multiple cookies on the visitor's system, usually three cookies-- one that expires at the end of the day, one that expires at the end of the week, and one that expires at the end of the month.
Our team has been debating why this is common and we have been tearing our hair out to figure out why one might do this.
The only thing we can think of is performance: this way you can calculate whether a visitor is repeat per day, week, or month without having to do heavy queries on the OLTP database all the time. But we can conceive of ways to make it work anyway.
What are the advantages to creating the tracking cookies in this way, and how do you think they're being used by others?