User Session timeout

Nirav Shah Posted in Beginning Developers 4 years ago

Hi,

I am new to OSSN, thank you for putting this together, highly appreciate it. I had a question, is there a way we can increase the user session timeout, when someone log's in after a short while gets logged out, is there a way/file that I can edit the session time. Would like to extend it to 7days.

Thank you in advance for the assistance.
Warm Regards
Nirav Shah

Replies
in Nirav Shah Replied 4 years ago

Hi,

I tried a lot of things, however, what seemed to initially work, eventually did not. After an hour or so it logs me out when I have the sessions setting set to 7 days.

So I have given up on this one and using another script.

us Philip Lozier Replied 4 years ago

I need to do the same thing. Is it just the last line posted, "session_start", or the combination of all shown?

us William Shoap Replied 4 years ago

Hi Nirav, what path did you find the file? I need to do the same thing. Thank you.

in Nirav Shah Replied 4 years ago

Ok, this is what worked for me.

classes -> OssnSession.php

session_start(['cookie_lifetime' => 604800,]);
in Nirav Shah Replied 4 years ago

Thank you @arsalan Shah for taking the time to share, I have already tried that in the classes -> OssnSession.php

and add the below code. But made no difference. Did a cache flush and delete system cache too.

public static function start() {
iniset('session.cookielifetime', 604800);
iniset('session.gcmaxlifetime', 604800);
iniset('session.gcprobability', 1);
iniset('session.gcdivisor', 100);

            session_start();

    }