Session_cache_limiter () returns the name of the current cache restriction. if cache_limiter is specified, the name of the current cache restriction is changed to a new value. the cache limit controls the Cache Control for sending HTTP hair to the client. the header content of these page content rules can be cached. if the cache is set to "no cache", no client cache is allowed. however, public variables can be cached. it can also be set to private, which is a little more restrictive than public.
String session_cache_limiter ([string cache_limiter])
Session_cache_limiter () returns the name of the current cache restriction. If cache_limiter is specified, the name of the current cache restriction is changed to a new value.
The cache limit controls the Cache Control for sending http hair to the client. the header content of these page content rules can be cached. if the cache is set to "no cache", no client cache is allowed. however, public variables can be cached. it can also be set to private, which is a little more restrictive than public.
The cache display is reset to the default value of session_cache_limiter at the beginning of the request. In this way, you need to call session_cache_limiter () for every request (before session_start ).
Set cache limit to 'private'
*/
Session_cache_limiter ('private ');
$ Cache_limiter = session_cache_limiter ();
/* Set the session expiration time to 30 seconds */
Session_cache_expire (30 );
$ Cache_expire = session_cache_expire ();
/* Initialize the session */
Session_start ();
/* Output result content */
Echo "the current session cache restriction is set to: $ cache_limiter <br/> ";
Echo "current session expiration time: $ cache_expire minutes ";
/*
Output result:
The cache limiter is now set to private
The cached session pages expire after 30 minutes
*/
// Instance 2
/* Set caceh to 'private '*/
Session_cache_limiter ('private ');
/* Return caceh limiters */
$ Cache_limiter = session_cache_limiter ();
Echo "the current session cache restriction is set to: $ cache_limiter <br/> ";
// Instance 3
$ Filename = "test. mpeg ";
$ Filepath = "test. mpeg ";
Session_start ();
/* Initialize the session */
Session_commit ();
/* Output the requested file */
Header ("content-type: audio/x-mpeg"); // or other types of files
Header ("content-disposition: attachment; filename =". $ filename );
Header ("content-length:". $ filesize );
Header ("content-transfer-encoding: binarynn ");
Header ("pragma: no-cache ");
Header ("expires: 0 ");
$ File_contents = file_get_contents ($ filepath );
Print ($ file_contents
);