PHP Session Upload Progress "Undefined index: upload_progress_" Wordpress
<p>I'm creating a file upload progress bar, and I am unable to get it working. Relative code is as follows.</p>

<p>Relating Form HTML</p>

<pre><code>&lt;form action="" method="post" id="uploadForm" enctype="multipart/form-data"&gt;
            &lt;div id="uploadFields"&gt;
                &lt;?php
                    $val = time();
                    echo '&lt;input type="hidden" class="progress" name="'.ini_get('session.upload_progress.name').'" value="'.$val.'" required /&gt;";
                ?&gt;
                &lt;label&gt;Select file to upload:&lt;/label&gt;
                    &lt;input type="file" name="fileToUpload" id="fileToUpload" required&gt;&lt;br&gt;&lt;br&gt;
</code></pre>

<p><strong>Ajax.js</strong></p>

<pre><code>$(document).ready(function(){
$('#uploadForm').submit(function(){
/***I insert picture to upload page, this responds to my later AJAX request***/
    sendRequest();
});
});

function sendRequest() {
var progress = $(".progress").val();
$.ajax({ 
    type: "POST",
    url: ajaxurl,
    data: { 
        PHP_SESSION_UPLOAD_PROGRESS: progress,
        action: "uploadProgress"
    },
    success:function(result){
        console.log(result);
        handleResponse(result);
    }
});
}

function handleResponse(result) {
if (result &lt; 100) {
    $("#loading-gif").css("left", result + "%");
    setTimeout("sendRequest()", 1000);
}
}
</code></pre>

<p><strong>PHP progress function</strong></p>

<pre><code>function uploadProgress(){

    $key = ini_get("session.upload_progress.prefix") . $_POST[ini_get("session.upload_progress.name")];
/*** error line ***/    echo print_r($_SESSION[$key]);
    if(!empty($_SESSION[$key])) {
        $current = $_SESSION[$key]["bytes_processed"];
        $total = $_SESSION[$key]["content_length"];
        echo $current &lt; $total ? ceil($current / $total * 100) : 100;
    }else {
        echo 'empty';
    }

    wp_die();
}
</code></pre>

<p>I've gone through dozens of forums, read the manuals and instructions on php.net, tried different forms of trying to get this working, but it's not working.
Specifically, with the code above, I get the error log:
PHP Notice:  <strong>*Undefined index: upload_progress_1468284727 in D:*****\wordpress\*****\functions.php on line 581*</strong></p>

<p>The '14682284727' is a dynamic value (made through time()) to ensure no race condition, and so that each upload is unique - hoping this should remove any caching issue too. I have echoed out the time given in the form, and the same variable passed through to the progress function, and the error log, and they are the exact same.
I'm not running PHP through FastCGI. </p>

<p>I have all session_upload_progress related instructions set in PHP.ini, importantly <strong><em>session.upload_progress.enabled = On</em></strong>, <strong><em>session.upload_progress.cleanup = Off</em></strong>, this should allow me to print out the array. 
I'm running PHP 5.4.5 with admin access to all files/folders. All other session variables are being kept, and I am using them successfully from page to page. </p>

<p>I've done a ridiculous amount of debugging this, but with no progress. I'm stuck at this point. The progress function is returning 1 for printing the $_SESSION array, and empty as for the size of the array.
No flash based solution. I just want to know what I have missed, what I am doing wrong, what I could be doing better?</p>

<p>Any ideas/suggestions would be most appreciated.</p>