How can session.use_trans_sid be changed in PHP configuration to prevent unwanted session IDs in URLs?

To prevent unwanted session IDs from appearing in URLs, the session.use_trans_sid configuration in PHP can be set to false. This will disable the automatic appending of the session ID to URLs. By doing this, the session ID will only be passed through cookies, which is a more secure method of handling sessions.

// Disable automatic appending of session ID to URLs
ini_set('session.use_trans_sid', false);