How to simulate a background action to solve inactivity problem?

Asked

Viewed 22 times

0

I have a website in ASP.NET MVC5 in the company "Vaipapai" (no merchandising here right), this hosting is shared and I can not decide the downtime for the session to fall, in the case as default they put 6 minutes. This is currently a problem because I can’t afford a more personalized service, and I need longer sessions.

It is possible through the server side or the client side to simulate actions in the background, whatever so that the session does not fall at that time, either with c#(server side) or javascript(front side) ?

  • In the client you can create a call Ajax for a server operation and call periodically using setTimeout (https://www.w3schools.com/jsref/met_win_settimeout.asp) for example, or on the server, create a method that uses a Timer (https://docs.microsoft.com/pt-br/dotnet/framework/winforms/controls/run-procedures-at-set-intervals-with-wf-timer-component) to execute a code that keeps your session active

  • Hello, I had to do this a while ago and I implemented this solution and it worked for me: https://gist.github.com/KyleMit/aa4f576fa32bf36fbedab5540c18211d

  • 1

    @Ricardopunctual I used your method and it worked ;)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.