Welcome Guest, Not a member yet? Register   Sign In
iframe not seeing session variable assigned in popup window

[eluser]spider pig[/eluser]

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:

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
    $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:
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);
    $row->al_main_content = $this->products_model->options_list();
    $this->load->view('product/iframe', $row);

The session library is auto loaded.

Any ideas?

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

Theme © iAndrew 2016 - Forum software by © MyBB