session
English [?se?n] US [?s???n]
n. Meeting, meeting; (court) session; session, semester; (carrying out an activity Continuous) a period of time
cache
英[k??] 美[k??]
n. Hiding place; hiding place; hidden treasure ;<Computer>Quick buffer storage area
vt.storage
vi.hide
php session_cache_expire() function syntax
Function:Return the expiration time of the current cache
Syntax: int session_cache_expire ([ string $new_cache_expire ] )
Parameters:
Parameter | Description |
new_cache_expire | If given new_cache_expire, use the value of new_cache_expire to set the current cache expiration time. |
Description: session_cache_expire() returns the setting value of session.cache_expire. When the request starts, the cache expiration time will be reset to 180 and stored in the session.cache_expire configuration item. Therefore, for each request, session_cache_expire() needs to be called before the session_start() function is called to set the cache expiration time.
php session_cache_expire() function example
<?php /* 設置緩存限制為 “private” */ session_cache_limiter('private'); $cache_limiter = session_cache_limiter(); /* 設置緩存過期時間為 30 分鐘 */ session_cache_expire(30); $cache_expire = session_cache_expire(); /* 開始會話 */ session_start(); echo "The cache limiter is now set to $cache_limiter<br />"; echo "The cached session pages expire after $cache_expire minutes"; ?>
Run instance?
Click the "Run instance" button to view the online instance
Output:
The cache limiter is now set to private The cached session pages expire after 30 minutes