Here we will learn with the help of an example that how we can set the time for session cache expire in php. We use a function session_cache_expire() which returns the current setting of session.cache_expire.
Example
<?php
/*Here we are setting the cache limiter to 'private' */
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
/* Here we are setting the cache expire to 25 minutes */
session_cache_expire(25);
$cache_expire = session_cache_expire();
/* Now we start the session */
session_start();
echo "The cached session pages will expire after the set time i.e. 25 minutes ";
?>
0 Comment(s)