How can the lifetime of PHP sessions be restricted to only last until the browser is closed?
To restrict the lifetime of PHP sessions to only last until the browser is closed, you can set the session cookie to be a session cookie by not setting an expiration time. This will ensure that the session cookie is deleted when the browser is closed.
// Set session cookie to be a session cookie (deleted when browser is closed)
ini_set('session.cookie_lifetime', 0);