How can the error "Cannot send session cache limiter - headers already sent" be resolved in a PHP script using sessions?

The error "Cannot send session cache limiter - headers already sent" occurs when there is whitespace or output sent before session_start() is called in a PHP script. To resolve this issue, make sure that there is no output (including whitespace) before session_start() is called in the script.

<?php
ob_start(); // output buffering starts
session_start(); // start the session
// your PHP code here
?>