What is a Heart Beat Design Pattern? How does this relate to an ASP.NET session?

What is a heart pattern? How does this relate to an ASP.NET session?

+4
source share
2 answers

The web application receives an HTTP request from a user browser. It contains session information so that (for example) a basket or an online game state between these requests can be saved.

The user usually leaves the browser session active while going for lunch, home for a day, or leaving for a two-week vacation. Consequently, sessions usually have some inactivity timeout, otherwise you get a lot of server resources that are used for users who are not coming back soon.

The heartbeat template described here uses Ajax (asynch) calls to tell the server that the user is still here. This can be useful because rich Internet applications often allow you to work quite a bit locally before new requests are sent to the server - therefore, there is a risk of disconnecting sessions when the user is happy to use the application.

Implementation must be reasonable. For example, if you just have to send an ajax call to the server every thirty seconds, saying "Yes, still here," which will continue until the user has a two-week vacation. Thus, instead of this, the pulse will only be sent when the user is actively using the application.

It might be wise to “correct” useful information in requests and responses to the pulse, for example, by sending to the server automatic data storage or retrieving updated server information or “news”.

+4
source

This template focuses on saving an ASP.NET session.

Take a look at Heart Pattern Beat Design - Saving the Session Alive Web Page for Implementation in .NET.

+1
source

All Articles