session_start(), Pragma and Cache-control headers

From: Date: Mon, 22 Aug 2005 17:01:29 +0000
Subject: session_start(), Pragma and Cache-control headers
Groups: php.general 
Request: Send a blank email to php-general+get-221103@lists.php.net to get a copy of this message
Hello, I'm working on a downbload script which serves M3U files (Winamp playlist files) through a PHP file like this : somepath/download.m3u.php?id=2 Then in the PHP script I generate the M3U file, and serve up the headers I want. Swell so far, but a little problem appears. The downloads are for members only, and therefor I need to check if the user is logged in, I do this by sessions and therefore I add a session_start() at the start of my file. When I do this some headers are added to the file, namely : Set-Cookie: PHPSESSID=xxx; path=/ 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 Theese headers are not needed, and I dont want them either, exept I cant seem to get rid of them since I need the session_start() in the beginning of the file. Sure, I could wish for a function unset_potensial_header(pragma); I guess there are no way to remove theese unwanted headers? Yesterday I had to give up another problem, but luckily I found the answer here : http://bugs.php.net/bug.php?id=33057 So to sum it up : How can I remove the Cache-Control and Pragma headers? And Im not looking for this answer : header('Pragma: '); header('Cache-control: '); The headers are still sendt, exept they are empty, doesnt look like a nice sollution for a production environment. Kind regards, Kim Steinhaug - - - - - - - - - www.steinhaug.com

« previous php.general (#221103) next »