Session cleared on second ajax call

Here my problem is a bit strange, I only see it on my working server. Basically, I am losing session values ​​in the second ajax call. The whole process is like the user pushing a button to initiate the synchronization process, which includes two ajax hits, first a send request and the successful completion of this second receive request.

My code is as follows:

JQuery Code:

//User clicks "SyncButton" to initiate sync process
    $('#SyncButton').on('click', function (event) {
        //Some UI Code
        $.ajax({
            type: 'POST',
            beforeSend: startService,   //startService has some UI code
            url: "FirstAjaxURL",
            data: null,
            contentType: "application/json",
            success: function (data) {
                ServiceSuccess(data);
            },
            error: serviceError
        });
    });

function ServiceSuccess(data) {
    var html = ''; //code to get html from data
    $('#divSync').html(html);
    if (!($('#delete').length > 0)) {
        RenderBusinessGrid();
    }
};

function RenderBusinessGrid() {
    var allBusiness = "";
    $.getJSON("SecondAjaxURL", function (data) {
        //Some UI handling code
    });
    $('#divSyncDetails').height('400px');
}

MVC Code:

[HttpPost]
public string FirstAjaxURL()
{
    //make some DB hits
    //fetch data
    //create couple of zip files

EDIT July 6, 2015

    //Unzip a zip file in one of the sub-directories. This zip file contains multiple sub-directories and files.

EDIT July 6, 2015

    //save them in two separate folders in separate folders under root directory

    /*LOGS SUGGEST ALL SESSION KEYS WERE AVAILABLE HERE*/
    return "some string result";
}

public ActionResult SecondAjaxURL()
{
    /*LOGS SUGGEST SESSION KEYS NOT AVAILABLE HERE*/

    //do some DB operation 
    return jsonResult;
}

What I have tried so far:

  • Checked IIS settings for application pool restart time, they look fine
  • The session timeout is set to a large value, it does not turn off if I leave the system idle
  • Confirmed absence of unhandled exception on first ajax hit
  • zip
  • $.getJson $.ajax( , , ...:)

. - ajax . , .

: , , , :

: 4005 : . : .

, , /, , . .

, Ravi

+4
2

. , , asp.net ?.

: , , cookie , . , machineKey web.config .

+1

: ajax , / / -, , - .

: (FCN)

. , / -. -, .

:

enter image description here

, webapp , :)

enter image description here

. FCNMode web.config, , , .NET 4.5, , , . , .

0

All Articles