How can session timeout be extended in PHP for local testing?

To extend session timeout in PHP for local testing, you can increase the session.gc_maxlifetime value in your php.ini file. This value represents the maximum lifetime of a session in seconds before it is considered garbage and cleaned up. By setting this value to a higher number, you can extend the session timeout for your local testing environment.

// Set session timeout to 1 hour (3600 seconds)
ini_set('session.gc_maxlifetime', 3600);

// Start the session
session_start();