• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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