session_cache_expire

(PHP 4 >= 4.2.0, PHP 5, PHP 7)

session_cache_expire锟斤拷锟截碉拷前锟斤拷锟斤拷牡锟斤拷锟绞憋拷锟�

说锟斤拷

session_cache_expire ([ string $new_cache_expire ] ) : int

session_cache_expire() 锟斤拷锟斤拷 session.cache_expire 锟斤拷锟借定值锟斤拷

锟斤拷锟斤拷始锟斤拷时锟津,伙拷锟芥到锟斤拷时锟斤拷岜伙拷锟斤拷锟轿� 180锟斤拷锟斤拷锟揭憋拷锟斤拷锟斤拷 session.cache_expire 锟斤拷锟斤拷锟斤拷锟叫★拷 锟斤拷耍锟斤拷锟斤拷每锟斤拷锟斤拷锟斤拷锟斤拷要锟斤拷 session_start() 锟斤拷锟斤拷锟斤拷锟斤拷之前 锟斤拷锟斤拷 session_cache_expire() 锟斤拷锟斤拷锟矫伙拷锟芥到锟斤拷时锟戒。

锟斤拷锟斤拷

new_cache_expire

锟斤拷锟斤拷锟斤拷锟� new_cache_expire 锟斤拷锟斤拷使锟斤拷 new_cache_expire 锟斤拷值锟斤拷锟矫碉拷前锟斤拷锟芥到锟斤拷时锟戒。

Note: 锟斤拷锟斤拷 session.cache_limiter 锟斤拷锟斤拷锟斤拷值 锟斤拷锟斤拷 nocache 锟斤拷时锟斤拷 锟脚匡拷锟斤拷锟斤拷锟斤拷 new_cache_expire 锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷 session.cache_expire 锟侥碉拷前锟斤拷锟斤拷值锟斤拷 锟皆凤拷锟斤拷为锟斤拷位锟斤拷默锟斤拷值锟斤拷 180 锟斤拷锟斤拷锟接o拷锟斤拷

锟斤拷锟斤拷

Example #1 session_cache_expire() 示锟斤拷

<?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";
?>

锟轿硷拷