• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Session expired in app ASP.NET CORE hosted in plesk.

jefffernando

New Pleskian
Hello to the whole community, I am new.

Plesk Obsidian 18.0.28.

I will try to communicate in the best possible way, my native speaking is Spanish, if something is not clear please let me know.

Currently I bought a web hosting, where it allows Unlimited Dedicated app pools.

The problem I am having is that the session of my user in your application closes every 5 minutes, and that is very little time.

I configured the section where it says windows authentication in 60 minutes and in my application too, I think this happens because the session is hosted in IIS POOL and due to inactivity it is recycled every 5 minutes (configured by default in shared windows hosting, no I can change it)

View attachment 17369

Cookies are kept in my application's browser, but the session is lost, it requests to log in again, this is because when the application is hosted in the APP pool, it restarts and being in the volatile memory, the session is lost .
View attachment 17370
Try to publish the dotnet core application out of process (you shouldn't miss the session, you still get lost)

Search a lot of information on the web and I can't solve my problem, if someone had this problem, or some similar experience it would be very helpful.

Best regards,
 
I think this happens because the session is hosted in IIS POOL and due to inactivity it is recycled every 5 minutes (configured by default in shared windows hosting, no I can change it)

You are correct. You need to increase the "Idle Time-out (minutes)" in the application pool. If possible ask your host to create a seperate appliaction pool for your app and change the time-out value for you.
 
Hi Adam_K60,

It does not allow me to increase the time, that option is blocked and they told me that it is not possible, what I implemented was a code that every 4 minutes makes a request on the web so that the pool does not restart, thank you very much for your answer.

If I can help someone else I will leave the code I made.

30 minutes passed and my session is still alive ♥, in web hosting they did not know how to help me.

In Layout page, ( or master page)

$(document).ready(function () {
setInterval(function MantenerVivo() {
$.ajax({
type: "GET",
url: "/Home/MantenerConVida",
dataType: "json",
success: function (response) {

},
failure: function (response) {
alert("Por favor, pongase en contacto conmigo....");
}
});
}, 240000); //Set interval in miliseconds, 4 minutes = 240000
});

In Controller Home:

[Authorize]
public IActionResult MantenerConVida()
{
return Json(new { data = "IDLE TIME OUT? HAHA", success= true });
}


1597505325650.png


Have a nice day, and thanks for your help!
 
Back
Top