PHP session_start() overwrites HTTP Expires header

只谈情不闲聊 提交于 2019-11-28 05:46:31

问题


I am trying to set Expire header to 2 hours from access for text/html by using mod_expires like that:

<IfModule mod_expires.c>
   ExpiresActive on
   ExpiresDefault "access plus 2 hours"
   ExpiresByType text/html "access plus 2 hours"
</IfModule>

However when used with PHP:

session_start();

Expires header is being reset to:

Expires: Thu, 19 Nov 1981 08:52:00 GMT

Any ideas how to avoid that overwrite by session_start()?


回答1:


OK, looks like have found an answer:

session_cache_limiter('public');
session_start();

does the trick, thanks.



来源:https://stackoverflow.com/questions/4521086/php-session-start-overwrites-http-expires-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!