session_cache_expire — Returns the Current Cache Expiration Time in PHP
This article explains the PHP function session_cache_expire(), describing its purpose of returning the current session cache expiration value in minutes, its optional parameter for setting a new expiration time, the default return value, and provides a complete example demonstrating how to configure and display the cache limiter and expiration settings.
The PHP function session_cache_expire() returns the current value of session.cache_expire, which determines how long cached session pages remain valid; the default is 180 minutes.
Parameter : an optional $new_cache_expire string or integer can be passed to set a new cache expiration time (in minutes).
Return value : the function returns the current cache expiration setting in minutes.
Example usage :
<?php
/* Set cache limiter to "private" */
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
/* Set cache expiration time to 30 minutes */
session_cache_expire(30);
$cache_expire = session_cache_expire();
/* Start the session */
session_start();
echo "The cache limiter is now set to $cache_limiter<br />";
echo "The cached session pages expire after $cache_expire minutes";
?>Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
