try
ini_set('session.gc_maxlifetime',54000);
ini_set('session.gc_probability',1);
ini_set('session.gc_divisor',1);
use this before calling session_start()
Or Also Try by this
Store time() in the $time variable.
After that check the condition that if $_SESSION['setTime'] is empty OR not set then store the timeout value into the session, otherwise when the page will refresh the new value will be assigned to the $_SESSION['setTime'].
$time = time ();
$setTime = time () + 60;
if (empty ( $_SESSION ['setTime'] ) || !isset ( $_SESSION ['setTime'] )) {
$_SESSION ['setTime'] = $setTime;
}
After that check that current time is more than equal to the stored time. and if it is unset the session. destroy the session as well.
if (time () >= ( int ) $_SESSION ['setTime']) {
session_unset ();
session_destroy ();
}
AS per how to expire php session if user is inactive for 15 mins