Context Object

Description

The Context object is automatically available to Xbasic code that runs on the stand-alone application server and the IIS application server. It has all properties needed to handle an HTTP request and response as well as access to session and security information.

Name
Description
ApplicationConfiguration

The ApplicationConfiguration object. It has properties that identify the platform and vary depending on the platform.

DataCache

The DataCache object. It has properties and methods needed to manage the grid cache.

Context.Request Object

The Context.Request object contains properties and methods available for working with the current HTTP request.

Context.Response Object

Context.Response object properties and methods.

Context.Security Object

Context.Security object properties and methods

Context.Session Object

Context.Session object properties and methods.

Using the Context object is the preferred way to get information about a request, response, or other context of the server since other objects have been deprecated since version 11. Many of the deprecated objects will not work under IIS.

Pre-Context object
Context object
a5ws_GetCurrentUser()

Context.Security.CurrentUser

Application.Path()

Context.Request.ApplicationRoot

a5ws_securityactive()

Context.Security.IsActive

Properties

ApplicationConfiguration

Context.ApplicationConfiguration contains constant values that vary depending on the deployment platform. Read Only.

CookieSameSiteCharacter

The value used for a cookie's SameSite property. Possible values are unset (meaning no value), "None", "Lax", or "Strict". Read Only

GridCacheAlpha5DotNet.DataCache

GridCache contains the methods and properties available for working with the GridCache. Read Only.

HostContextPointer

The type of HostContext depends on the platform that the code is running under. Under IIS HostContext is of type System.Web.HttpContext and all properties and methods available on that .NET object are available in Xbasic. Under the stand-alone application server HostContext is of type A5AS::A5INETServerIntegration::A5WServerContext. Read Only

HostContextNameCharacter

Context.HostContextName contains the name of the platform on which the code is running. This will be "IIS" when running on IIS and will be "Alpha Anywhere Application Server" when running on the stand-alone server. Read Only.

Request

Context.Request contains methods and properties for the current HTTP request. Read Only

Response

Context.Response contains methods and properties for the current HTTP response. Read Only

SecurityA5INETServerIntegration::IA5WebSecurityContext

Context.Security contains the methods and properties available for working with security.Read Only.

ServerSoftwareCharacter

Context.ServerSoftware contains the product name and version. Read Only.

Example value: Alpha Anywhere Application Server for IIS Development Server/12.0 Build/3816-4723

Session

Context.Session contains the methods and properties available for working with the current session. Read Only.

Methods

ResolveMimeType Method

Returns the MIME type of the given file name.