php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #40390 Documentation is not clear on header() behaviour
Submitted: 2007-02-07 16:40 UTC Modified: 2007-03-23 17:32 UTC
From: razvan dot pop at micronets dot ro Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2007-02-07 16:40 UTC] razvan dot pop at micronets dot ro
Description:
------------
The documentation page for the header() function (http://www.php.net/manual/en/function.header.php) doesn't officialy state that setting headers in this manner:

header('Cache-Control:');
header('Pragma:');

will prevent those headers from being sent even if previously set. Ie. it will efectively delete the headers.



Reproduce code:
---------------
<?php

session_cache_limiter('nocache');
session_start();
header('Cache-Control: max-age=10000');
header('Pragma:'); // deletes "Pragma: no-cache" set by
                   // session_cache_limiter
header('Expires:');

?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-23 17:32 UTC] vrana@php.net
It doesn't prevent the headers to be sent, it just send them empty.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Nov 19 19:00:01 2025 UTC