I have listed the complete header sent by the server with php4, along with their respective scripts.
Here is an interesting observation.
I think actually there are two headers browsers check for displaying the session expired message. One is the "Cache-Control:" and other is the "Expires:".
When a session is started, a cookie is sent and also the Expires header. My server sends a Expires header having a date which is earlier than the current date. (see script 2 given below and the headers).
session.cache_limiter does exactly this, it does not send the three headers namely Cache-control, Expires and pragma if set to null as you did rightly.
This can also be achieved by using the 3rd script given below. Here, headers will still be sent, but with empty values.
You may use your technique which is shorter than my workaround.
1.
<?php
//session_start();
header("Cache-Control: ");
header("pragma: ");
?>
HTTP/1.1 200 OK
Date: Fri, 24 Aug 2001 06:29:27 GMT
Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01
X-Powered-By: PHP/4.0.4pl1
Cache-Control:
pragma:
Connection: close
Content-Type: text/html
2.
<?php
session_start();
header("Cache-Control: ");
header("pragma: ");
?>
HTTP/1.1 200 OK
Date: Fri, 24 Aug 2001 06:27:06 GMT
Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01
X-Powered-By: PHP/4.0.4pl1
Set-Cookie: PHPSESSID=91184a56bb5d260fbb0aa912795cc90b; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control:
Pragma:
Connection: close
Content-Type: text/html
3.
<?php
session_start();
header("Cache-Control: ");
header("Expires: ");
header("pragma: ");
?>
HTTP/1.1 200 OK
Date: Fri, 24 Aug 2001 06:27:38 GMT
Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01
X-Powered-By: PHP/4.0.4pl1
Set-Cookie: PHPSESSID=949523cb30eef497407e0cf29bfbd2f3; path=/
Expires:
Cache-Control:
Pragma:
Connection: close
Content-Type: text/html
4.
<?php
ini_set("session.cache_limiter","");
session_start();
?>
HTTP/1.1 200 OK
Date: Fri, 24 Aug 2001 06:27:15 GMT
Server: Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01
X-Powered-By: PHP/4.0.4pl1
Set-Cookie: PHPSESSID=563c02bb37810f7a1a2c8e7cc2c9a782; path=/
Connection: close
Content-Type: text/html