Solved

Maximum Cookie Lifetime?

Posted on 2004-08-16
3
1,642 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
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
Several part series to implement Internet Explorer 11 Enterprise Mode
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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 +…

733 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