Mayor of the Plattenbaus
Mayor of the Plattenbaus

Reputation: 1160

What does session_cache_limiter(false) do?

On the session_cache_limiter() documentation page, several options are given for values that can be passed to the function.

But none of them is a boolean. I'm now seeing session_cache_limiter(false); in some legacy code I'm working on, and I'm curious about what it does. Can anyone explain this to me?

Upvotes: 1

Views: 2949

Answers (1)

nass190
nass190

Reputation: 96

The possible values for session_cache_limiter() are : public, private_no_expire, private and nocache

If it's false it will not add one of the following header : Expires, Cache-Control, Last-Modified.

You can test it by calling session_start() and check the HTTP Headers from the Dev tools of your browser.

https://php.net/manual/en/function.session-cache-limiter.php

Upvotes: 2

Related Questions