简体   繁体   English

会话超时问题

[英]Issue with session timeout

When a user logged in, after some time the session times out and redirects to the home page. 用户登录后,一段时间后会话超时并重定向到主页。

Does anyone know why this may be occurring? 有谁知道为什么会这样?

Following code is used for logout: 以下代码用于注销:

if($user->isLogged())
{
    $user->logout();
    $session->set('error','Successfully Logged Out');
    $response->redirect('index.php');
}

function logout() {     
     $this->session->delete('user_id');
     $this->data = array();
}

function isLogged() {
    return !empty($this->data);
}

Is there any way for increasing session time? 有什么办法可以增加会话时间?

ini_set('session.gc_maxlifetime', '28800'); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM