I have an asp.net mvc application and I have this weird thing that happens and I don't know why.
Context:
I have a page that allows the user to draw and edit images. On this page there is a function that makes an ajax call for the server every 5 minutes using jquery, saving the current state of the project in the database and another call to save the image of the project storing it in the right place.
Problem:
When the browser is minimized when this function is launched, after calling ajax to the server, the cookie client is deleted. But when chrome maximizes, it works great.
Notes:
- This only happens if the browser is minimized.
- This happens, at least in chrome and firefox.
- This only happens in a production environment. On my local machine and in the visual studio, I cannot reproduce the problem.
- Asp.net session mantainned cookie
I know that itβs difficult for you to help only with this information, but if you can give me tips, it will be very useful. I am trying to identify a problem so that we can match similar problems to find the best solution for this case.
Thank you in advance
[EDIT] :
I have some new problems:
- Using Chrome version 63.0.3239.84 (official build) (64-bit);
- Firefox quant 57.0 (64-bit);
- Unlike what I thought at first, this happens even if the browser is not minimized and exactly 3 mints after the page loads (if I call the function)
- The cookie is not deleted, but the contents of the cookie:

- This is an asp.net web application.
- The console does not give any errors.
- Request Version 2.1.3
Executes 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)); } }); }
source share