I have a wordpress site which has some pages written in custom php code which uses session variables but these session variables exist for a small time in site. I want to increase session time so i pasted this code in wp-config.php file.
if (!defined('SESSION_LIFETIME')) {
define('SESSION_LIFETIME', 3600); // Change 3600 to the number of seconds you want
}
ini_set('session.gc_maxlifetime', SESSION_LIFETIME);
ini_set('session.cookie_lifetime', SESSION_LIFETIME);
if (!isset($_SESSION)) {
session_start();
}
Still my session gets over in 10 minutes only. How to fix it