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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: razvan dot pop at micronets dot ro
New email:
PHP Version: OS:

 

 [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-2026 The PHP Group
All rights reserved.
Last updated: Sun Feb 08 06:00:02 2026 UTC