Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5940033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:54:42+00:00 2026-05-22T15:54:42+00:00

While testing some scripts, I’ve noticed, if expiration time is little (not zero) –

  • 0

While testing some scripts, I’ve noticed, if expiration time is little (not zero) – cookie isn’t available in Chrome, Opera, IE.

Example:

<?php
// setting cookie for 5 minutes
setcookie( 'cookie1' , 'Test', time()+60*5 );
echo $_COOKIE['cookie1'];
// yeap (it should display it only with refresh of page - I know:)
?>

In Firefox – I see the word Test (after opening and refreshing the page).

But in other browser – I don’t see this.
If I change time to time()+60*100 for example – it works fine in all browsers.

What’s the reason of this?

UPD:

From Chome Dev Tool (sorry, don’t know how Chrome firebug is called):

Date:Sun, 22 May 2011 10:29:59 GMT
Keep-Alive:timeout=15, max=99
Server:Apache/2.2.14 (Ubuntu)
Set-Cookie:Maslo123=Test; expires=Sun, 22-May-2011 10:34:59 GMT

Date is early than ‘expires’;

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:54:43+00:00Added an answer on May 22, 2026 at 3:54 pm

    As we have already acquired that your server’s time is wrong by few hours and thus the cookies are already expired.

    The reason why Firefox still stores the cookie might be that it detect the odd time difference between the server and the client and uses the difference between the Date value and the Expires attribute value to determine the cookie expiration date.

    These issues are also the reason why latter RFC standards like the current RFC 6265 prefer the relative time value of delta seconds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been testing some stuff with Google maps, and while this code gives me
I've got a weird problem while testing some code in Groovy Console. The following
While testing a console app, I set the properties of the console window to
I'm facing a problem while unit testing my forms. The problem is that data
While trying to answer a question in the vicinity ' Unit Testing WPF Bindings
I was given this code a while back. I finally got around to testing
Often while coding view templates in html, my habit of adding some helpful comments
I'm testing out some of the examples in Rapid GUI Programming with Python and
I'm looking for some tool that would do basic testing of PHP script. This
I've started to look into the whole unit testing/test-driven development idea, and the more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.