http ajax request fails randomly

4 posts, 0 answers
  1. Doug
    Doug avatar
    17 posts
    Member since:
    Aug 2015

    Posted 02 Mar Link to this post

    I'm not sure it this is a bug or something on our web server (Apache 2.2.1) but randomly the first ajax request sent to our web server will not have a SSL_SESSION_ID.  I've printed out and compared the environment variables and there are only two that differ from a working and non working request, but I'm not sure what to make of them.

    For a working connection they show up as:

    HTTP_ORIGIN: https://ourservername.com

    HTTP_X_REQUESTED_WITH: XMLHttpRequest

     

    For a failed attempt they show up as:

    HTTP_ORIGIN: file://

    HTTP_X_REQUESTED_WITH: com.ourservername.mmb (mmb is the folder our app resides in)

    If you wait 10 seconds and try the request a second time, it works fine, and for that session all further requests also work.  It's just the very first ones (if you wait less than about 10 seconds, it may or may not continue to fail).

    It's a pretty standard request using a datasource:

     

        app.appTokenData = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "https://ourservername.com/cgi-bin/mmb/login.cgi",
                    dataType: "json",
                    type: "post",
                    data: {
                        username: function () {
                            return $('#username').val();
                        },
                        password: function () {
                            return $('#password').val();
                        },
                        datacentre: function () {
                            return $('#datacentre').val();
                        }
                    }
                }
            },
     ...

    Has anyone had this problem, and what might correct it?

     

  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 07 Mar Link to this post

    Hello Doug,

    The issue doesn't seem related to the DataSource itself, rather to the handshake between your server and the client. You can check if the issue is related to Cordova or Kendo UI at all by creating a simple HTML page that makes an identical request to your server via jQuery.ajax.

    Also, aren't you getting the SSL_SESSION_ID from the server? If you are, it is expected that it is missing in the first request from the client. In such case, you may need to make such a request on app start up, before the user triggers a login request.

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Doug
    Doug avatar
    17 posts
    Member since:
    Aug 2015

    Posted 21 Mar in reply to Tsvetina Link to this post

    I built a test page, and after numerous tries it appears to be working fine. If you send me an email, I will send you the link so that you can use it for your own validation.  I tried the test web page on my desktop as well as on the android phone that I use for testing.  We also use this without problems in other online (not mobile) apps that we use.

    So far it appears to be a problem in either Cordova or Kendo.  BTW, it's been doing this for a long time.  I just assumed it was a problem in the testing environment, but now that I'm doing more testing on an actual device, it happens regularly there too.

  4. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 24 Mar Link to this post

    Hello Doug,

    You can open a support ticket if you log into your Telerik account and click the Get Support button. In the ticket you can attach your sample or send us the link to it. 

    If you think the issue may be Cordova-related, you can try updating the Cordova version and checking again. 

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top