PHP session_cache_limiter() Function

What is session_cache_limiter Function?

Explanation

The "session_cache_limiter()" function is used to get or set the current cache limiter.

Syntax:


session_cache_limiter(string)

In the above syntax "string" specifies the values for the cache limiter if set to "nocache" disallows any proxy or client, "public" allows caching by any proxy or client, "private" disallows caching by proxies and permits caching by the client.

Example :


<?php
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
echo "The cache limiter is now set to $cache_limiter<br/>";
?>
Result :

The cache limiter is now set to private

In the above example the session cache limiter is set to "private" to disallow caching by proxies and allow caching by client.

PHP Topics


Ask Questions

Ask Question