简体   繁体   中英

PHP Session Adding Headers Pragma: no-cache

Hi People, i have problem with http headers request, when i test header i get this response

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

This part ist come out only if i have session_start() on page

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

On clean pages .php or .html pages i get this respond

  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

I try search evrywhere but no idea im bloked Sombody have idea why session_start(); add

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

in http headers????????

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM