Why is “Expires” 1981?

后端 未结 4 615
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 04:39

My CRON Job returned an error that CRON job did not work. In that this was there:

Set-Cookie: PHPSESSID=2t2drultihqc         


        
相关标签:
4条回答
  • 2020-12-03 04:49

    HTTP Expires header

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

    It is set to negative or past value, to prevent caching of response.

    Quite common usage of this header.

    0 讨论(0)
  • 2020-12-03 04:50

    It's an attempt to disable caching.

    The date is the birthday of the developer Sascha Schumann who added the code.

    From session.c:

    Authors: Sascha Schumann <sascha@schumann.cx> 
             Andrei Zmievski <andrei@php.net> 
    
    // ...
    
    CACHE_LIMITER_FUNC(private)
    {
        ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
        CACHE_LIMITER(private_no_expire)(TSRMLS_C);
    }
    
    0 讨论(0)
  • 2020-12-03 04:57

    I think you are using session_cache_limiter before calling session_start. If argument is private or no-cache the result is setting the Expires header to the time you have mentioned. Refer to this document for more information.

    0 讨论(0)
  • 2020-12-03 04:57

    Somebody just put expires = date('-30 years') (paraphrased) in his code to make really sure the content is set as expired and not cached.

    0 讨论(0)
提交回复
热议问题