Remove the session_start() from inside the for loop.
Put the session_commit() outside the for loop at the very end.
Both these functions should only be called once in a script.
Related Contents:
- How to fix "Headers already sent" error in PHP
- Returning JSON from a PHP Script
- Why I have to call ‘exit’ after redirection through header(‘Location..’) in PHP?
- PHP generate file for download then redirect
- PHP page redirect [duplicate]
- PHP error: Cannot modify header information – headers already sent [duplicate]
- Why won’t my PHP app send a 404 error?
- Header only retrieval in php via curl
- correct PHP headers for pdf file download
- Prevent sent emails treated as junk mails using php mail function
- Warning: Cannot modify header information – headers already sent by ERROR [duplicate]
- Symfony2 – Force file download
- PHP, display image with Header()
- Creating a PHP header/footer
- PHP header(Location: …): Force URL change in address bar
- PHP header() redirect with POST variables [duplicate]
- php, file download
- header location not working in my php code
- How to send a status code in PHP, without maintaining an array of status names?
- PHP headers already sent [duplicate]
- What is the format for e-mail headers that display a name rather than the e-mail?
- Which line break in php mail header, \r\n or \n?
- Undefined index with PHP sessions
- HTTP response code after redirect
- Show Curl POST Request Headers? Is there a way to do this?
- PHP get pdf file from base64 encoded data string
- Why would one omit the close tag?
- Fatal error: Call to undefined function mysqli_connect()
- How to properly add cross-site request forgery (CSRF) token using PHP
- Special characters in property name of object
- How to parse SOAP XML?
- Escaping single quote in PHP when inserting into MySQL [duplicate]
- How to extract text from the PDF document? [closed]
- Executing multiple SQL queries in one statement with PHP
- Is it possible to replace (monkeypatch) PHP functions?
- How can I get a div content in php
- How do I use cookies across two different domains?
- Request Entity Too Large PHP
- how to bind multiple parameters to MySQLi query [closed]
- Executing a shell script from a PHP script
- Get service via class name from iterable – injected tagged services
- Will enabling XDebug on a production server make PHP slower?
- how to redirect STDOUT to a file in PHP?
- How to set .env values in laravel programmatically on the fly
- Setup HTTP expires headers using PHP and Apache
- How to get previous month and year relative to today, using strtotime and date?
- Laravel 5.3 – How to add Sessions to `API` without CSRF?
- “PHP Fatal error: Class ‘HttpRequest’ not found”
- Undefined Index while uploading file
- Generate PDF report from php