Responds to the relationship between the Date attribute and the cookie expiration time in the http message,

Source: Internet
Author: User

Responds to the relationship between the Date attribute and the cookie expiration time in the http message,

When I tested. net today, I found an inexplicable problem: Cookies cannot be stored on the browser;

After careful comparison between successful and unsuccessful packets, I accidentally found that the Date is related to it, which is too unexpected. I never knew that the date in the packet should be considered when the cookie is saved.

Instead of setting the cookie's expiration date, the expiration time is based on date, rather than the client machine time on the browser side?


The following code verifies that the date time of a message is the start time of the cookie expiration time:


Header ('date: Mon, 17 Mar 2015 05:34:54 gmt'); // force modify the response time to the next day of the day. The normal time point should be the current
Setcookie ('A', rand (), time () + 3600); // The cookie expires in an hour.


This code will find that the cookie is not saved in the browser, because the browser thinks that the cookie has expired relative to the date, so it is not saved,

But according to my understanding, the start time of the cookie should be the time of the client?

Therefore, I do not know whether the date of the http attribute has such a role.



After my colleagues' efforts, I found this was a bug in iis. "After going up, I don't want to go down ";

From http://serverfault.com/questions/217343/date-header-returned-by-iis7-is-wrong


This appears to be a known issue and frequently found on virtual machine due to time sync feature. You may need to restart HTTP service on IIS6 to recover the behavior. Please refer to the content below:

Problem Description

W3SVC logs show incorrect time-stuck on the same time 2007-11-04 04:56:06

REPRO STEPS
  1. Changed the system time to a future time (e.g. 11th May 2020)
  2. Browsed any site-verified the log file created in the new date/time
  3. Changed the system time to be correct (today's date and time)
  4. Now, browsed any website and saw that the time on the log files is now stuck on 11th May 2020's time
RESOLUTION
  • Net stop http
  • Net start w3svc

OR

  • Net stop http
  • Net start http
  • Iisreset

You must restart the http service whenever you change the date in the server.

Verified in the code and confirmed that this is by design and you need to follow the above steps to make IIS logging the correct time.

I hope the information helps.

Source: http://www.eggheadcafe.com/software/aspnet/31164622/wrong-date-and-time-in-iis-log-file.aspx



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.