title: Codeigniter: Message: Cannot modify header error
body: <p><strong>This type of question is already asked before</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/5115430/codeigniter-headers-already-sent-error">Codeigniter: headers already sent error</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19293909/codeigniter-headers-already-sent-error-with-different-server">CodeIgniter headers already sent error with different Server</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14769209/codeigniter-cannot-modify-header-information-headers-already-sent-by">Codeigniter - Cannot modify header information - headers already sent by</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15974891/codeigniter-message-cannot-modify-header-information-headers-already-sent-by">Codeigniter: Message: Cannot modify header information - headers already sent by (output started at</a></p>
  
  <p><a href="http://ellislab.com/forums/viewthread/69280/#468283" rel="nofollow noreferrer">http://ellislab.com/forums/viewthread/69280/#468283</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15974891/codeigniter-message-cannot-modify-header-information-headers-already-sent-by">Codeigniter: Message: Cannot modify header information - headers already sent by (output started at</a></p>
  
  <p><strong>Exact Error I am Getting</strong></p>
  
  <pre><code>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
  </code></pre>
  
  <p>What i am doing at <strong>welcome.php:472 Line</strong></p>
  
  <p>I am changing a session value like as below</p>
  
  <pre><code>$value="Some Value";
  $session_data=array("hotel_search_value" =&gt; $value);
  $this-&gt;session-&gt;set_userdata($session_data);
  </code></pre>
  
  <p><strong>I have tried in below ways.</strong></p>
  
  <ol>
  <li>Checked White spaces  <code>before &lt;?php and after ?&gt;</code> (Everything is fine.No white spaces).</li>
  <li>Changed <strong>$_SERVER['REMOTE_ADDR']</strong> to <strong>$this->server('remote_addr')</strong> in line system/core/Input.php Line no <strong>351</strong></li>
  </ol>
  
  <p>But those things didnt solve my problem.</p>
  
  <p>Can anyone help me out in this issue.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Sree ram</p>