Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4054638
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:36:03+00:00 2026-05-20T14:36:03+00:00

I’m at a loss with an annoying issue to do with exporting a report.

  • 0

I’m at a loss with an annoying issue to do with exporting a report. Basically, a button is pressed and a report is generated server side using the following javascript:-

__callExportController(true, { op: 'build', type: exportType }, function(data) {
    var outputURL = './reportinc/export_controller.php?op=output&filename=';
    var reportFilename = data['filename'];
    var reportTitle = data['title'];

    if (reportFilename && reportTitle) {

        var resultURL = outputURL + reportFilename + '&title=' + reportTitle;

        /* Initiate the download dialog */
        if (!$('#exportFrame').length) {
            var hiddenIFrame = document.createElement('iframe');
            hiddenIFrame.setAttribute('id','exportFrame');
            document.body.appendChild(hiddenIFrame);
        }

        $('#exportFrame').attr('src', resultURL);
    } else {
        error('No filename or report title specified!');
    }
});

The ‘build’ operation of the export controller builds the report to a temporary file on the server. If that succeeds, the ‘output’ operation is called to output that file to a hidden iframe in order to get the download prompt to the user. Internet Explorer 6/7 are the only browsers in use here.

This is the output handler on the server which the iframe will be requesting with the successfully built filename:-

/* Output handler */
case 'output':{

    $filename = $_GET['filename'];

    header('Content-Description: File Transfer');
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");
    header("Content-Type: application/pdf");

    /**
     * NOTE: It appears this is required for some versions of adobe!
     * http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=15400
     */
    header("Cache-Control: private");
    header("Pragma: cache");
    header("Content-Disposition: attachment; filename=\"file.pdf\"");
    header('Content-Length: ' . filesize($filename));

    /* Flush the headers immediately for larger files */
    ob_clean();
    flush();
    readfile($filename);
    @unlink($filename);
}

The issue I’m having is: whilst this works fine once, the session appears to be destroyed after the first successful file download. That is, when the user navigates away to another page they appear to be generated a new session id. This also requires the user to have to ‘re-login’ if basic authentication is in use with the next action they take.

The issue seems very intermittent and it seems to happen at times and not at other times.

Has anyone any ideas? Should I be adding more headers or something to prevent the users session from being destroyed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:36:04+00:00Added an answer on May 20, 2026 at 2:36 pm

    if the top level domain of the iframe is not the equal the Ie will revert to the p3p protocol and deletes the session. adding a header will fix this issue.

    http://weblogs.asp.net/coltk/archive/2010/10/13/session-lost-in-iframe-p3p-issue.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.