/** * [shell 登陆超时] * @param [type] $onlinetime [description] * @return [type] [description] */ function shell($onlinetime){ $newtime=time(); if($newtime-$onlinetime >3000){ if(isset($_SESSION['username']) && isset($_SESSION['uid'])){ unset($_SESSION['username']); unset($_SESSION['uid']); $this->error('登录超时!',U('Login/index')); } }else{ $_SESSION['time']=time(); } }