簡體   English   中英

PHP會話添加標題實用程序:無緩存

[英]PHP Session Adding Headers Pragma: no-cache

嗨,大家好,我在測試HTTP標頭時遇到了問題,當我測試標頭時,我得到了這個響應

HTTP/1.1 200 OK
Date: Sat, 29 Oct 2016 14:24:31 GMT
Server: Apache
X-Powered-By: PHP/5.6.27
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
    check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=2d17992cfbd621c51eca940df478b89a; path=/
Vary: Accept-Encoding,User-Agent
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Security-Policy: allow 'self';
X-Content-Type-Options: nosniff
Cache-Control: max-age=604800, must-revalidate
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Content-Language: it-it

僅當我在頁面上具有session_start()時,此部分才會出現

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
    check=0
Pragma: no-cache

在干凈的頁面.php或.html頁面上,我得到此響應

  HTTP/1.1 200 OK
    Date: Sat, 29 Oct 2016 14:34:27 GMT
    Server: Apache
    Last-Modified: Sat, 29 Oct 2016 13:15:00 GMT
    Accept-Ranges: bytes
    Content-Length: 314
    Vary: Accept-Encoding,User-Agent
    Cache-Control: max-age=604800, must-revalidate
    Expires: Sat, 29 Oct 2016 14:34:27 GMT
    X-Frame-Options: SAMEORIGIN
    X-XSS-Protection: 1; mode=block
    X-Content-Security-Policy: allow 'self';
    X-Content-Type-Options: nosniff
    Connection: close
    Content-Type: text/html; charset=UTF-8
    Content-Language: it-it

我嘗試搜索evrywhere,但沒有一個想法讓Sombody知道為什么session_start();。

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
    check=0
Pragma: no-cache

在http標題中????????

http://php.net/manual/en/function.session-cache-limiter.php

session_cache_limiter('private_no_expire:');
session_start();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM