If you look at the PHP doc help for function session_cache_limiter(), you will see that if the cache_limiter parameter is set to private or nocache the Expires HTTP header is set to a const date (Thu, 19 Nov 1981 08:52:00 GMT). I understand that this is a date in the past to avoid caching, but why this date/time in particular? It's not the 0 date, my guess is that this is some kind of easter egg. If it's some kind of dummy value in the past, can I change it for something else (still in the past) and still have the private/nocache mechanism still working?
+2
A:
it is the birthday of the person who contributed the code:
diffs: http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.80&r2=1.81
http://www.phpbuilder.com/lists/php3-list/199911/3159.php
to change it, it would be preferable to set the headers manually, for example nocache sets this:
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
but you could still do:
session_cache_limiter('nocache')
header('Expires: Thu, 1 Jan 2000 00:00:00 GMT');
header will replace any existing header with the same name (by default).
jspcal
2010-01-19 16:26:11
OK so overwriting the HTTP Expires value with another date in the past will not affect the private or nocache mechanism?
AlexV
2010-01-19 16:39:54
It shouldn't affect it, no.
Anthony Forloney
2010-01-19 16:43:01
yep as Anthony mention... headers set by session_cache_limiter when you call it, so you can overwrite... (why can't i post comments? hmm)
jspcal
2010-01-19 16:48:37
why can't you? I can
Anthony Forloney
2010-01-19 16:49:03
@Anthony: my net was on the fritz, it's better now :)
jspcal
2010-01-19 17:00:32