The VariableStore
interface defines a simple way to store and retrieve string-based key/value pairs. This is implemented by ProxyRequestContext
and AppSession
.
Method | Return Type | Arguments | Description |
getVariable |
String | String name | Retrieve the currently stored value of the named variable. |
setVariable |
void | String name, String value | Store a new value for the named variable. |
Example
An example of a session variable – during sign-on, we are redirected to the login page of the target application. We want to store this because we base the logout URL on the login URL.
x
this.onGetLoginResponse = function(ctx) {
var loginPage = ctx.appResponse.getHeader('location');
// (various error checks here)
ctx.appSession.setVariable("loginPage", loginPage);
// (continue login sequence)
}
this.signOff = function(ctx) {
ctx.startSsoRequest("GET", ctx.appSession.getVariable("loginPage").replace("login", "logout"),
function onLogoutResponseWrapper(ctx) { self.onLogoutResponse(ctx); });
};
Special Variables
Name | Scope | Type | Meaning |
retrySignOnThreshold |
AppSession | Long (milliseconds) | Throttle sign-on attempts by specifying a period which must elapse before reattempting sign-on after a failed attempt.
The default value for this is taken from the config property edgeWeb.retrySignOnThreshold. |