Solved

Maximum Cookie Lifetime?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Problem I downloaded the Microsoft Internet Explorer 9 Beta, today, to give it a test drive and maybe write a review for the site, and it failed miserably and got stuck in a crash restart loop. The error message given is as illustrated below i…
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
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 +…

776 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