weixin_33688840 2017-12-06 15:37 采纳率: 0%
浏览 38

Cookies被删除

I have an asp.net mvc application and I have this strange thing that is happening and I don't know why.

Context:

I have a page that allows the user draw and edit images. This page has a feature that each 5 minutes, she made a ajax call to the server using jquery, saving the current state of the project on the database and another call to save an image of the project that is storage in a proper place.

Problem:

With the browser minimized, when this feature is launched, after the ajax call to the server, the cookie Customer is deleted. But when the chrome is maximized, this works fine.

Notes:

  1. This only happens when the browser is minimized
  2. This is happening, at least, in chrome and firefox.
  3. This is only happens on the production environment. On my local machine and on visual studio i cannot reproduce the issue
  4. The asp.net session cookie is mantainned

I know that is difficult for you to help only with this information, but, if you can give me clues it will be really helpful. I'm trying to expose the problem so we can match similar issues to find the best solution for this case.

Thank you in advance

[EDIT]:

I have some new about the issue:

  1. Using Chrome Version 63.0.3239.84 (Official Build) (64-bit);
  2. Firefox quantum 57.0 (64-bit);
  3. Contrary that I first thought, this is happens even if the browser is not minimized and precisely 3 mints after the page load (if I call the function)
  4. The cookie are not being deleted but the content of the cookie is: enter image description here
  5. This is a asp.net web application
  6. The console does not gives any errors
  7. The version of query is 2.1.3
  8. Follows the jquery call code:

    makeAjaxCall(ajaxData) {
    var localData = ajaxData.data ? ajaxData.data : {},
        urlVariables = {};
    
    localData.cmd = ajaxData.cmd;
    
    var controlerURL = ajaxData.uploadUrl ? HelperJSViewBag.getValue("ajaxCAllUploadURL") : ajaxData.controller;
    
    if (typeof ajaxData.data.urlVariables == "undefined")
        ajaxData.data.urlVariables = [];
    
    let editorVersion = "";
    let forceEditorVersion = "";
    
    if (typeof UrlParameters != "undefined") {
        editorVersion = UrlParameters.getInstance().editorVersion;
        forceEditorVersion = UrlParameters.getInstance().forceEditorVersion;
    }
    else if (typeof HLinks != "undefined") {
        editorVersion = HLinks.getUrlVariable("editorVersion");
        forceEditorVersion = HLinks.getUrlVariable("forceEditorVersion");
    }
    
    if (editorVersion.length > 0)
        ajaxData.data.urlVariables.push({
            name: "editorVersion",
            value: editorVersion,
        });
    
    if (forceEditorVersion.length > 0)
        ajaxData.data.urlVariables.push({
            name: "forceEditorVersion",
            value: forceEditorVersion,
        });
    
    if (typeof ajaxData.data.urlVariables != "undefined" && ajaxData.data.urlVariables.length > 0)
        for (var i = 0; i < ajaxData.data.urlVariables.length; i++)
            urlVariables[ajaxData.data.urlVariables[i].name] = ajaxData.data.urlVariables[i].value;
    
    localData = this.fillLocalData(localData);
    
    return $.ajax({
        type: 'POST',
        data: localData,
        url: controlerURL + "?" + $.param(urlVariables),
        success: function (data) {
            try {
                var result = JSON.parse(data),
                    status = result.status;
    
                delete result.status
                switch (status) {
                    case 1: ajaxData.sucess && ajaxData.sucess(result.data); break;
                    case 2: ajaxData.insucess && ajaxData.insucess(ajaxData.errorHandler && ajaxData.errorHandler.handle && ajaxData.errorHandler.handle(result)); break;
                }
            }
            catch (ex) {
                ajaxData.insucess && ajaxData.insucess(ajaxData.errorHandler && ajaxData.errorHandler.handle && ajaxData.errorHandler.handle(ex));
            }
        },
        error: function (data) {
            ajaxData.insucess && ajaxData.insucess(ajaxData.errorHandler && ajaxData.errorHandler.handle && ajaxData.errorHandler.handle(data));
        }
    });
    }
    
  • 写回答

2条回答

      报告相同问题?

      悬赏问题

      • ¥30 如何降低hdfs中datanode的JVM内存用量
      • ¥20 SQL数据查询,子查询
      • ¥15 c++字符串分割问题
      • ¥15 vue+uniapp
      • ¥15 android freedom
      • ¥15 使用自定义的类型代替内置类型可行吗
      • ¥15 关于STM32的SPI和ENDAT接口编码器通信的问题
      • ¥15 关于#pdfbox#生成的PDF文件正常,转图片中文乱码的问题,如何解决?
      • ¥15 ADS中有关DAC控件的使用问题
      • ¥15 win11如何运行geoserver