We have an Angular web application fully service oriented and the ng-front end is consuming the REST web services via ng-services (so far standard). To avoid any automatic POST request from bots or programs we are using a CSRF (Cross-site request forgery) Token which is server validated and after 15 mins expires.
The problem: if we have long sessions on the same page without reloading, the token expires (for example during fairies or because of long forms).
The idea is to build a keep-alive service (heartbeat) to 'refresh' automatically in background the session (until the customer browser is open).
Any idea? best practice? Thanks