How can PHP settings like session.gc_maxlifetime and session.cookie_lifetime affect session management?
PHP settings like session.gc_maxlifetime and session.cookie_lifetime can affect session management by determining how long a session will last before it is automatically garbage collected or the session cookie expires. Adjusting these settings can help control the duration of user sessions and improve security by limiting the time a session remains active.
// Set session.gc_maxlifetime to 1 hour
ini_set('session.gc_maxlifetime', 3600);
// Set session.cookie_lifetime to 1 hour
ini_set('session.cookie_lifetime', 3600);