I use ajax to get the access token from the external API. How can I store the expired time across the site and the ajax only call again when the session expired?
test.js
/helloworld/index/display is the controller that will get the input from Store -> Configuration and call the external API by using cURL
$.ajax({
url: "/helloworld/index/display",
type: "GET",
complete: function (response) {
access_token = response.responseText;
}
});