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
?>
Keywords
Related Questions
- How can PHP developers avoid issues with special characters like '|' when storing chat messages in a database?
- How can error suppression be used in PHP to prevent default error messages from being displayed?
- Are there any standard features in Mediawiki that automatically generate user-specific pages?