Problems with Session in 2.2



Support 2 years ago by jhossmx

Hi, i have some questions about session in version 2.2 of frameworks: 1.- how much time the ssession is a live? 2.- how i a can chage time of session? 3.- how i can keep a live a session?

thanks you..



2 years ago by daveismyname

1) the session exists for the duration that's default on the server running so it's impossible to say 2) you can set your own settings on the init function inside the session helper:

public static function init(){
    ini_set('session.cookie_lifetime', 60 * 60 * 24 * 30);
    ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 30);
    ini_set('session.save_path', 'files/sessions');

    if(self::$_sessionStarted == false){
        session_start();
        self::$_sessionStarted = true;
    }

}

3) that's more tricky have a look at https://stackoverflow.com/questions/12597176/how-to-keep-session-alive-without-reloading-page


Login to reply.