登陆一个系统,如果长时间不操作(假如15分钟),系统就退出。
请问这样的代码如何写?

解决方案 »

  1.   

    呵呵,现在很多成熟的cms都有这样的功能呀。譬如joomla的administrator部分,登录之后,15min不操作,系统自动登出
      

  2.   

    发现网上cms都是经过加密的!
      

  3.   

    这是session超时。只要使用session保存用户信息就可以了,
    其他的都有服务器自动完成。
      

  4.   

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

  5.   

    Session
    而且可以设置Session过期的时间
      

  6.   

    Session~正解~
    具体参看
    http://www.w3school.com.cn/php/php_sessions.asp
      

  7.   


    joomla是完全的开源的呀。正如楼上几位所说的那样,也是用session来实现的