How can PHP.ini be modified to adjust session expiration settings for better session management?

To adjust session expiration settings for better session management in PHP, you can modify the session.gc_maxlifetime value in the php.ini file. This value represents the number of seconds after which session data will be considered garbage and cleaned up. By increasing this value, you can extend the session expiration time and improve session management.

// Modify session expiration settings in php.ini
ini_set('session.gc_maxlifetime', 3600); // Set session expiration time to 1 hour