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
Solved

Maximum Cookie Lifetime?

Posted on 2004-08-16
3
1,631 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Sudden problem (grey screen) playing flash files in any browser, any OS 7 90
Mac Os Sierra Safari Tabs 12 64
ms/access hyperlink/ftp 7 49
Hide http port number 5 52
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 XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
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 +…

828 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