CodeIgniter Forums
Sesion already sent problem - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Sesion already sent problem (/showthread.php?tid=13107)

Sesion already sent problem - El Forum - 11-11-2008

[eluser]new developer[/eluser]
I have a problem saying session headers already sent. I worked the same code on Wamp but i installed Xampp recently. It gives me an error. My code is really simple as below. Can anyone please help me rectify this.

class Welcome extends Controller {

    function Welcome()

    function index(){
    $data['main'] = 'adminLogin';
      $data['title']= 'Welcome to my first aplication';

      function verifyMe(){
      $u = $this->input->post('username');
      $p = $this->input->post('password');
      $this-> MAdmins-> verifyUser($u,$p);
    if ($_SESSION['userid'] > 0){
         $this-> session-> set_flashdata(error  , 'Login failed');


Sesion already sent problem - El Forum - 12-30-2008

I don't know if this is still relevant, but I was having a similar problem for a while this morning. My issue was a blank link under my closing php tag at the end of my user_model.php file. For some reason that blank line got rendered as display data and those the headers were thrown.

Sesion already sent problem - El Forum - 12-30-2008

I would go with jwindhorst.
I don't see anything else where you are sending any data to the browser that would cause the error.
Make sure there's no white space anywhere after the PHP closing or opening tags.

Sesion already sent problem - El Forum - 12-30-2008

That's why I follow CodeIgniter's footsteps and don't use a closing ?> tag in my controllers, libraries, models, hooks, etc..

The only place I use the closing tag is in my views (if my views contain php).