• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iframe not seeing session variable assigned in popup window

#1
[eluser]spider pig[/eluser]
Hi

I am writing the software to add an option to a product (i.e. colour range). The user selects a option in a popup window and there is a iframe that contains the list of selected options. The following script is run when the option is selected in the popup window:

Code:
function modify() {
    $prodOptions = $this->session->userdata('prodOptions');
    $prodOptions[] = $this->uri->segment(6, 0);
    $this->session->set_userdata('prodOptions', $prodOptions);
    $row->al_main_content = '<div class="message"><h4>The option has been added to the product.</h4></div>'.LF
            .'[removed]'.LF.'opener.frames["OptionsFrame"].location.reload();'.LF.'[removed]'.LF;
    $this->load->view('product/options_popup', $row);
}

The iframe is reloaded ok, but the session variable does not contain the value set in the popup window.

Here is the code for the iframe:
Code:
function iframe() {
    if ($this->session->userdata('prodOptions') == NULL or $this->session->userdata('prodOptions') == array()) {
        $row->al_main_content = '<h5>No product options have been selected.</h5>'.LF;
        $this->load->view('product/iframe', $row);
        return;
    }
    $row->al_main_content = $this->products_model->options_list();
    $this->load->view('product/iframe', $row);
}

The session library is auto loaded.

Any ideas?

#2
[eluser]spider pig[/eluser]
DOOH! I had cookies switched off in my web browser. Another seniors moment Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.