Welcome Guest, Not a member yet? Register   Sign In
ci session not working with firefox....
#1

[eluser]ranjitbd[/eluser]
Code:
// this is my holiday controller

<?php
    class Holiday extends Controller {

    function Holiday()
    {
        parent::Controller();
        $this->load->model($this->config->item('holiday_model'), 'holiday', TRUE);
    }    

    
    function index()
    {    
        $data = array();
        $data['tab_data'] = $this->holiday->get_tab_data();
        $data['mainContent'] = $this->load->view('holiday/holiday', $data, TRUE);
        $this->load->view('index', $data);
    }
        
    function confirm()
    {
        $data = array();
        $data['mainContent'] = $this->load->view('holiday/confirmation', $data, true);
        $this->load->view('index', $data);    
    }
    
    function booking_confirmation()
    {
                global $data;
                $reff = array();
                $id = $this->uri->segment(4);
                $url = base64_decode($this->uri->segment(5));
        
        $reff = $this->holiday->check_reff_num();
                    if($reff['count_id'] == 0)
                        $data['reference_no'] = 'HA00000A';
                    else
                    {
                        $final_reff = $this->holiday->get_reff_num($reff['max_id']);
                        $final_reff = substr($final_reff, 1);
                        $data['reference_no'] = 'H'.generate_reference($final_reff);
                    }
                
                $data['package_id'] = $id;
        $data['package_url'] = $url;
        $data['departure_date'] = $this->input->post('departure_date', TRUE);
                if($data['departure_date'])
                {
                $from = split("/", $data['departure_date']);
        $data['departure_date'] = $from[2]."-".$from[0]."-".$from[1] ;
                }
                
                $data['first_name'] = $this->input->post('fname', TRUE);
        $data['last_name'] = $this->input->post('lname', TRUE);
        $data['email'] = $this->input->post('email', TRUE);
        $data['mobile'] = $this->input->post('mobile', TRUE);
              
        $result = $this->holiday->save_tourist_info($data);
                
// this php session is working in firefox
        $_SESSION['alternate_reff']= $data['reference_no'];
                
        $reff_num = array
                    (
                      'reference_no' => $data['reference_no'],
                      'save_reference' => 'ok'
                    );
// following codeigniter session is not working with firefox but working properly with Internate Explorer
                $this->session->set_userdata($reff_num);
                
        redirect('user/holiday/confirm');
    }
}
?>

//  this is my view page confirmation.php where reference number is showing

<?php if($this->session->userdata('save_reference') == 'ok')
          echo $this->session->userdata('reference_no');
// this code is working with IE but not working with fire fox.  
?>
<div>
    <div style="font-weight:bold" class="text_font">
            Thank you for your interest in our holiday package.
    </div><br>

    &lt;?php if($_SESSION['alternate_reff'] != '') {?&gt;
    <div class="text_font">
            Your Booking Reference Number is:<B>&lt;?php echo $_SESSION['alternate_reff'];?&gt;</B>.
    </div><br>
    &lt;?php } ?&gt;

    <div class="text_font">
            A TravelmartBD.com holiday executive will contact with you very soon with the information you need.
    </div>

</div>

// so what to do for using codeigniter session with firefox......
// please help....thanks in advance........
#2

[eluser]n0xie[/eluser]
Are you using database sessions?
Do you have webdeveloper add-on installed in firefox and can you see the contents of the cookie?
#3

[eluser]gigas10[/eluser]
You forgot session_start();
Code:
&lt;?php
    class Holiday extends Controller {

    function Holiday()
    {
        parent::Controller();
        session_start();
        $this->load->model($this->config->item('holiday_model'), 'holiday', TRUE);
    }

Don't worry I've done this like 4 times and I'm always baffled for a couple hours as to what is going wrong.

:-D




Theme © iAndrew 2016 - Forum software by © MyBB