简体   繁体   中英

Codeigniter: Message: Cannot modify header error

This type of question is already asked before

Codeigniter: headers already sent error

CodeIgniter headers already sent error with different Server

Codeigniter - Cannot modify header information - headers already sent by

Codeigniter: Message: Cannot modify header information - headers already sent by (output started at

http://ellislab.com/forums/viewthread/69280/#468283

Codeigniter: Message: Cannot modify header information - headers already sent by (output started at

Exact Error I am Getting

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2/hanomart/public_html/ClickMyStay/application/controllers/welcome.php:472)

Filename: libraries/Session.php

Line Number: 675

What i am doing at welcome.php:472 Line

I am changing a session value like as below

$value="Some Value";
$session_data=array("hotel_search_value" => $value);
$this->session->set_userdata($session_data);

I have tried in below ways.

  1. Checked White spaces before <?php and after ?> (Everything is fine.No white spaces).
  2. Changed $_SERVER['REMOTE_ADDR'] to $this->server('remote_addr') in line system/core/Input.php Line no 351

But those things didnt solve my problem.

Can anyone help me out in this issue.

Thanks in advance,

Sree ram

Turn off all echo() ing and var_dump() ing before line 472.

Headers are sent whenever is something echo() ed out so session library can not modify sessions in that point and it triggers error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM