title: Message: Undefined property: CI_Loader::$session using codeigniter
body: <blockquote>
    <p>set_flashdata to my contact us page when users successfully send their message, i just added the flashdata that successfully send. When i tried to upload the files to the live server and tested it ive got this error 
    Message: Undefined property: CI_Loader::$session
    it says that
    Fatal error: Call to a member function flashdata() on a non-object in /home/content/87/10599987/html/application/views/content/contact_us_content.php on line 18
    can someone figured me out how to set this?? 
    Here's my controller below</p>
  </blockquote>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  session_start();
  class Contact_us extends CI_Controller {
  
      public function __construct(){
        parent::__construct();
        $this-&gt;load-&gt;library('javascript');
        $this-&gt;load-&gt;library('form_validation');
        $this-&gt;load-&gt;library('email');
      }
  
      public function index(){
        $this-&gt;data['title'] = 'Contact Us | Spring Rain Global Consultancy Inc';
        $this-&gt;data['active_menu'] = 'contacts';
  
        $this-&gt;load-&gt;view('pages/header', $this-&gt;data);
        $this-&gt;load-&gt;view('templates/contacts', $this-&gt;data);
        $this-&gt;load-&gt;view('pages/footer');
        $this-&gt;load-&gt;view('pages/footer_below');
      }
  
      public function send(){
        $this-&gt;form_validation-&gt;set_rules('name', 'Name', 'required');
        $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'required|valid_email');
        $this-&gt;form_validation-&gt;set_rules('message', 'Message', 'required');
  
        if($this-&gt;form_validation-&gt;run() == FALSE){
          $this-&gt;data['title'] = 'Contact Us | Spring Rain Global Consultancy Inc';
          $this-&gt;data['active_menu'] = 'contacts';
  
          $this-&gt;load-&gt;view('pages/header', $this-&gt;data);
          $this-&gt;load-&gt;view('templates/contacts');
          $this-&gt;load-&gt;view('pages/footer');
          $this-&gt;load-&gt;view('pages/footer_below');
  
        }else{
          $name = $this-&gt;input-&gt;post('name');
          $email = $this-&gt;input-&gt;post('email');
          $msg = $this-&gt;input-&gt;post('message');
  
          $this-&gt;email-&gt;from('info@springrainglobal.com', 'SPRING RAIN GLOBAL CONSULTANCY INC');
          $this-&gt;email-&gt;to($email);
          $this-&gt;email-&gt;subject('CONTACT US! SPRING RAIN GLOBAL CONSULTANCY INC WEBSITE');
          $this-&gt;email-&gt;message("
                &lt;!DOCTYPE html&gt;
                  &lt;html&gt;
                  &lt;head&gt;
                  &lt;title&gt;Spring Rain Global Consultancy Inc&lt;/title&gt;
                  &lt;/head&gt;
                  &lt;body&gt;
                  &lt;div style='width:500px; &gt;
                    &lt;div style='width:500px;'&gt;
                      &lt;a href='http://www.springrainglobal.com' target='_blank' rel='nofollow' &gt;
                        &lt;img alt='springrain logo' src='http://www.springrainglobal.com/images/461962_333397740048531_1893235327_o(1).jpg' width='180' height='122' /&gt;
                      &lt;/a&gt;
                    &lt;/div&gt;
                    &lt;div style='margin-left:40px; margin-top:80px;'&gt;
                      &lt;h1&gt;
                          Thank you for contacting us!... &lt;br /&gt;
                          We will contact you within 48 hours.
                      &lt;/h1&gt;
                      &lt;br /&gt;
                      &lt;br /&gt;
                      &lt;br /&gt;
                      &lt;br /&gt;
                      &lt;br /&gt;
                      &lt;br /&gt;
                      &lt;p&gt;
                        SpringRain Global Consultancy Inc Team
  
                      &lt;/p&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;/body&gt;
                  &lt;/html&gt;
                  ");
          $this-&gt;email-&gt;send();
  
          $this-&gt;email-&gt;from('info@springrainglobal.com', $email);
          $list = array(
                    'macky_nyxz86@yahoo.com', 'info@springrainglobal.com'
                    );
          $this-&gt;email-&gt;to($list);
          $this-&gt;email-&gt;subject('CONTACT US! SPRING RAIN GLOBAL CONSULTANCY INC WEBSITE');
          $this-&gt;email-&gt;message("
                &lt;!DOCTYPE html&gt;
                &lt;html&gt;
                &lt;head&gt;
                &lt;title&gt;Spring Rain Global Consultancy Inc&lt;/title&gt;
                &lt;/head&gt;
                &lt;body&gt;
                &lt;div style='width:500px; &gt;
                  &lt;div style='width:500px;'&gt;
                    &lt;a href='http://www.springrainglobal.com' target='_blank' rel='nofollow' &gt;
                      &lt;img alt='springrain logo' src='http://www.springrainglobal.com/images/461962_333397740048531_1893235327_o(1).jpg' width='180' height='122' /&gt;
                    &lt;/a&gt;
  
                  &lt;/div&gt;
                  &lt;div style='margin-left:40px; margin-top:80px;'&gt;
                  &lt;p style='font-family:arial; font-size:13px;'&gt;&lt;strong&gt;Name :&lt;/strong&gt;".$name." &lt;/p&gt; 
                  &lt;p style='font-family:arial; font-size:13px;'&gt;&lt;strong&gt;Email :&lt;/strong&gt;".$email." &lt;/p&gt; 
                  &lt;p style='font-family:arial; font-size:13px;'&gt;&lt;strong&gt;Comments :&lt;/strong&gt;".$msg." &lt;/p&gt; 
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;/body&gt;
                &lt;/html&gt;
              ");
  
         if($this-&gt;email-&gt;send()){
            $this-&gt;data['title'] = 'Contact Us | Spring Rain Global Consultancy Inc';
            $this-&gt;data['active_menu'] = 'contacts';
  
            $this-&gt;load-&gt;view('pages/header', $this-&gt;data);
            $this-&gt;session-&gt;set_flashdata('success', 1);
            $this-&gt;load-&gt;view('templates/contacts');
            $this-&gt;load-&gt;view('pages/footer');
            $this-&gt;load-&gt;view('pages/footer_below');
            #echo "Thank you for contacting us! You will receive a reply to your email shortly";
            #echo "&lt;br /&gt;";
            #$this-&gt;sendNow();
  
         }else{
            //echo "failed";
            $this-&gt;data['title'] = 'Contact Us | Spring Rain Global Consultancy Inc';
            $this-&gt;data['active_menu'] = 'contacts';
  
            $this-&gt;load-&gt;view('pages/header', $this-&gt;data);
            $this-&gt;load-&gt;view('templates/contacts', $this-&gt;data);
            $this-&gt;load-&gt;view('pages/footer');
            $this-&gt;load-&gt;view('pages/footer_below');
         }
  
        }
      }
  
      private function sendNow(){
        echo "&lt;a href=''&gt;Contact Us&lt;/a&gt;";
      }
  
  }
  </code></pre>
  
  <p>i added the session_start() above the class contact_us  and the $this->session->set_flashdata on the if($this->email->send)
  Here's my view</p>
  
  <pre><code>    &lt;article id="content"&gt;
              &lt;section class="col1"&gt;
                  &lt;h2 class="pad_bot1"&gt;Feel Free To Contact Us!&lt;/h2&gt;
                  &lt;p class="pad_top1 pad_bot1"&gt;Thank you for taking the time to click through the SpringRain Global Consultancy Inc Site. If you have additional questions that needs to be
  answered, please feel free to fill out our contact form on the right side and we will get back to you as soon as we can. Please be sure to be specific and detailed
  in your message. Or send us direct email at : &lt;span style="color:green;"&gt;info@springrainglobal.com/ glenda@springrain.the.ph&lt;/span&gt;&lt;/p&gt;
                  &lt;p class="pad_bot1"&gt;&lt;/p&gt;
  
              &lt;/section&gt;
              &lt;section class="col2"&gt;
                  &lt;h2 class="pad_bot1"&gt;Send us a message!&lt;/h2&gt;
  
          &lt;?php if(!$this-&gt;session-&gt;flashdata('success')): ?&gt;
            &lt;form id="ContactForm" action="&lt;?php echo base_url().'contact-us/send.html'?&gt;" method="post"&gt;
              &lt;div&gt;
                &lt;?php echo validation_errors('&lt;div class="error"&gt;', '&lt;/div&gt;')?&gt;
  
                &lt;div  class="wrapper margint20"&gt;
                  &lt;span&gt;Your Name:&lt;/span&gt;
                  &lt;div class="bg"&gt;&lt;input type="text" id="name" name="name" class="input" autocomplete="off" value="&lt;?php echo set_value('name');?&gt;" placeholder="Your Name: " /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div  class="wrapper"&gt;
                  &lt;span&gt;Your E-mail:&lt;/span&gt;
                  &lt;div class="bg"&gt;&lt;input type="text" id="email" name="email" class="input" autocomplete="off"  value="&lt;?php echo set_value('email');?&gt;" placeholder="email@example.com" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div  class="textarea_box"&gt;
                  &lt;span&gt;Your Message:&lt;/span&gt;
                    &lt;div class="bg"&gt;&lt;textarea id="message" name="message" cols="1" rows="1" placeholder="Comments Here. . ." &gt;&lt;?php echo set_value('message');?&gt;&lt;/textarea&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div style="margin-left:200px; margin-top:20px;"&gt;
                  &lt;input type="submit" class="button" name="submit" value="Send" /&gt;
                  &lt;input type="reset" class="button" value="Clear"  /&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/form&gt;
          &lt;?php else: ?&gt;
            &lt;div class="send_msg"&gt;
              &lt;p&gt;Thank you for contacting us! You will receive a reply to your email shortly&lt;/p&gt;
            &lt;/div&gt;
            &lt;form id="ContactForm" action="&lt;?php echo base_url().'contact-us/send.html'?&gt;" method="post"&gt;
              &lt;div&gt;
                &lt;?php echo validation_errors('&lt;div class="error"&gt;', '&lt;/div&gt;')?&gt;
  
                &lt;div  class="wrapper margint20"&gt;
                  &lt;span&gt;Your Name:&lt;/span&gt;
                  &lt;div class="bg"&gt;&lt;input type="text" id="name" name="name" class="input" autocomplete="off" value="&lt;?php echo set_value('name');?&gt;" placeholder="Your Name: " /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div  class="wrapper"&gt;
                  &lt;span&gt;Your E-mail:&lt;/span&gt;
                  &lt;div class="bg"&gt;&lt;input type="text" id="email" name="email" class="input" autocomplete="off"  value="&lt;?php echo set_value('email');?&gt;" placeholder="email@example.com" /&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div  class="textarea_box"&gt;
                  &lt;span&gt;Your Message:&lt;/span&gt;
                    &lt;div class="bg"&gt;&lt;textarea id="message" name="message" cols="1" rows="1" placeholder="Comments Here. . ." &gt;&lt;?php echo set_value('message');?&gt;&lt;/textarea&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div style="margin-left:200px; margin-top:20px;"&gt;
                  &lt;input type="submit" class="button" name="submit" value="Send" /&gt;
                  &lt;input type="reset" class="button" value="Clear"  /&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/form&gt;
          &lt;?php endif; ?&gt;
              &lt;/section&gt;
          &lt;/article&gt;
  </code></pre>
  
  <p>the session on live server has error, can someone help me on this? any help is much greatly appreciated.</p>