I am controlling the user session with a single config file, included in every page. I have login/logout option in my website.
I want to extend user's session destroy timeout to 1 year (even when a user close his browser, the session should be still there unless the user log's out the page).
i am using this to extend user session timeout value,
<?php
session_set_cookie_params(31556952);
ini_set('session.gc_maxlifetime',31556952);
session_start();
//my Other code like DB connections will come below.
?>
and in the PHP.ini
I have set session.gc_maxlifetime
to 31556952
But this Doesn't affect anything, user session gets destroyed exactly at 120 second.
I have refered all the stackoverflow related questions but i didn't get any clue.
What would be the problem? any suggestions.