Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am wondering if there is any research on the lifespan of cookies on users computers?

For a website I'm building we are looking at giving the users some personalization based on a previous selection when they come back at a later point. However, our users mostly will come back a few months or even a year later.

Of course I can set the expiration time of the cookie to a year or longer. But overtime people get a new computer, a new install, or just a new browser (version). Or there might be other changes which make the cookie be deleted. I'm guess that the cookie won't survive the length of a year. Will it be worth saving this in a cookie? E.g., how much percentage of the cookies will still be there by that time?

share|improve this question
    
I say set it for one year and leave it at that. It doesn't take up that much space and, if it'll help the user when they revisit your page, it'll be worth it. –  Michael Todd May 9 '11 at 14:07
    
Sorry, I forgot to mention that I know the theoretical fact of setting the cookies expiration, but not know if the cookie will actually survive that. –  Lode May 9 '11 at 14:13
1  
As long as the user doesn't clear their cookies, the expiration date should be adhered to by the browser. –  Michael Todd May 9 '11 at 14:24
6  
...Until the Cookie Monster finds it! :P –  FrustratedWithFormsDesigner May 9 '11 at 14:44
    
depending on the nature of the site, session data can balloon if you dont delete old sessions regularly. So keep that in mind if your site receives a lot of casual traffic. –  GrandmasterB May 9 '11 at 18:05

2 Answers 2

If your user doesn't come back for a year, then whatever cookie-persisted personalization you have set has probably become moot. The user will not even remember that the personalization has been set.

Feel free to set your cookies for a year, but don't be too concerned if they expire before the user comes back.

share|improve this answer

If the users of your site have a login/account you might want to consider to store their personalization settings with their account details in the database. That way you don't need to worry about any cookie deletion or expiration.

share|improve this answer
    
Those I want this for don't, unfortunately. That is why I want this :) –  Lode May 9 '11 at 19:33
    
Fair enough, then my suggestion wouldn't help :) –  Tom van Enckevort May 10 '11 at 8:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.