What is the default session time and where is it located and how to change it ?

By default the session time in the PHP is 1440 seconds  i.e 24 minutes , and by default the session values are stored in the temporary folder called tmp .

We can change the default session time by using the following code below .

<?php

//In order to keep the session data at least 1 hour on server
ini_set('session.gc_maxlifetime', 3600);

// for  each client to remember their session id for 1 hour
session_set_cookie_params(3600);

?>

Leave a Reply

Your email address will not be published.Required fields are marked *