Solved

Maximum Cookie Lifetime?

Posted on 2004-08-16
3
1,659 Views
Last Modified: 2010-08-05
First off, I hope this is in the right area.

I'm writing a PHP script at the moment for a simple site which incorporates cookie-based logins. There is a "permanent login" function, for which a cookie is set, with a long lifetime.

My question is: is there a maximum lifetime for a cookie, and if so what is it?

If anyone knows the answer to this I'd be very grateful. I have tried 365 days so far, and that works fine.

Thanks,

  Biggs
0
Comment
Question by:BigglesZX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Assisted Solution

by:mattfairw
mattfairw earned 50 total points
ID: 11813364
Cookies stay on the users system until either:

A. they delte it
B. You delete it / Change its contents

So maximum life can be anything theoretically...but that may not always be the case
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 75 total points
ID: 11813523
January 19, 2038

Explanation:
This is caused by an overflow of the time_t variable in the C/C++ programming language. This variable is a 32-bit integer value used as an offset in seconds from January 1, 1970. This variable has a maximum value of 2147483647, which only allows dates through 3:14:07 GMT on January 19, 2038.
0
 

Author Comment

by:BigglesZX
ID: 11813884
Thanks chaps :-). Split points 'cos you both had good answers.

Regards,

Biggs
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Several part series to implement Internet Explorer 11 Enterprise Mode
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question