CI4 cannot start session - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: CI4 cannot start session (/showthread.php?tid=76443) |
CI4 cannot start session - hoffmanchan - 05-12-2020 I add a line in Base Controller and run session. PHP Code: <?php namespace App\Controllers; When I run my page, it show this massage : Quote:Fatal error: Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at C:\Users\hoffm\Dropbox\anaso\app\Config\Events.php:27) in C:\Users\hoffm\Dropbox\anaso\system\Debug\Exceptions.php:162 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', 'C:\\Users\\hoffm\\...', 162, Array) #1 C:\Users\hoffm\Dropbox\anaso\system\Debug\Exceptions.php(162): header('HTTP/1.1 500 In...', true, 500) #2 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #3 {main} thrown in C:\Users\hoffm\Dropbox\anaso\system\Debug\Exceptions.php on line 162 Do you have any suggestion for me ? please ~ RE: CI4 cannot start session - InsiteFX - 05-13-2020 It's telling you that you have already sent something to the screen. Check your code for output to the screen. RE: CI4 cannot start session - hoffmanchan - 05-13-2020 (05-13-2020, 03:17 AM)InsiteFX Wrote: It's telling you that you have already sent something to the screen. Thank you for your reply. I tried to download a new CI4, and start session in Base Controller directly. But the result is same the problem too. So, I think it is my code problem. RE: CI4 cannot start session - InsiteFX - 05-14-2020 Just look in your code where you are out putting to the view. Also make sure you are not using the BOM and there are no spaces after the php tag. And no ending php tag. |