Autoloading Sessions caused multiple errors |
[eluser]spyro[/eluser]
I have a parent controller class that every controller inherits from. Before adding sessions it just called one header view to use for everyone. Once I added sessions I gave it the capability to detect if a user was logged in and provide a different header view. See class below: Code: <?php When a user is logged in I don't get any errors. When a user is not logged in I get the following: A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\system\application\controllers\welcome.php:2) Filename: libraries/Session.php Line Number: 408 A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\system\application\controllers\welcome.php:2) Filename: libraries/Session.php Line Number: 662 Any idea on what is causing this?
[eluser]Arjen[/eluser]
Did you solve your problem yet? I get a simular error message when auloloading session library. I checked on white spaces after the last closing tags but couldn't find any. Any suggestions? :question:
[eluser]Arjen[/eluser]
I could fix the headers sent error with the next steps. I replaced the files database/drivers/mysql/mysql_driver.php and libraries/session.php with the files I downloaded from http://dev.ellislab.com/svn/CodeIgniter/trunk/system/ That was enough to get rid of the error messages. But I was still getting the same page twice, without any error message. After a search in my code lines there was a missing ';' in a model used bij DataMapper.
[eluser]spyro[/eluser]
I did get it fixed but am not sure what was causing it in this instance. I was loading headers and footers via the controller but moved to a wrapper view layout instead so that I could also pass data to the header and footer. Somehow that fixed the errors. I am guessing that there was some kind of problem with the order that stuff was getting loaded but I am really not sure. |
Welcome Guest, Not a member yet? Register Sign In |