سؤال

bootstrap.php:

Session::$default="native";

my session configure file:

return array(
    'native' => array(
        'name' => 'session',
        'lifetime' => 10, // 10 secs
    ),
);

I found the calculation of expired time is time() - session_created_time > lifetime, not time() - last_active_time > lifetime. is anyone who could told me how to fix that?

هل كانت مفيدة؟

المحلول

I added one statement to sync up session with client cookie, everything is ok.
setcookie($this->_name, session_id(), time()+$this->_lifetime, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);
in system\classes\Kohana\Session\Native.php#protected function _read($id = NULL)

نصائح أخرى

According to what I see in the Kohana's code, session['native']['lifetime'] is not working. I searched in the code for

ini_set('session.gc_maxlifetime', xxx)

and didnt find it. I had to put that line on my bootstrap.php

Can you tell me whether session['native']['lifetime'] is working or not?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top