2

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?

2
  • Check lt.php.net/manual/en/… Commented Dec 5, 2011 at 8:08
  • @Natasha: Your question is nearly a year old. How did you solve your problem? Commented Nov 16, 2012 at 12:02

1 Answer 1

1
ini_set('session.gc_maxlifetime', '28800'); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.