<?php/* set the cache limiter to 'private' */session_cache_limiter('private'); $cache_limiter = session_cache_limiter();/* set the cache expire 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"; ?>
客户端在操作画面,可是session时间还在计时,服务器端也是一样。
操作画面,一定会有提交表单等等可就是不正常
如果像写文章那样的操作,可以在页面通过js计时,如果一定时间内用户仍然在操作,则通过刷新框架页或者ajax刷新页面跟新服务器端的session计时
$cache_limiter = session_cache_limiter();/* set the cache expire 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";
?>
是不是需要改php.ini或者什么?
session_cache_limiter('private');
session_cache_expire(1);
也就是1分钟可就是不过期。郁闷ing...