 | | | S/Web Objects 

Client This object handles information relating to the client making the current request. Properties: | Property | Get/Set | Description |
|---|
| ANONYMOUS | Get/Set | Holds a Boolean value indicating if this client has been allowed in using an anonymous procedure. | | ANONYMOUSPROCS | Get/Set | Contains an @FM delimited list of SWEB_ procedures allowed anonymous access. Thus users may be allowed to access aspects of the system without logging in. | | BASICAUTHENTICATIONPROC | Get/Set | Contains the name of a function to use for verifying Basic Authentication requests | | BASICAUTHENTICATIONREALM | Get/Set | Contains the name of the realm used for Basic Authentication. This will be used as the title text in the basic authentication dialog. | | DATA | Get/Set | Holds any app-specific data defined that belongs to the client | | ERRORMSG | Get/Set | This property contains information about the error messages for the current instance of the object. This generally only happens with the login. | | ID | Get/Set | Holds the ID of the client that made the request | | LOGIN | Get/Set | True if this is the actual login request | | NAME | Get/Set | Contains the user name of the currently logged in user | | NOREDIRECT | | A Boolean flag indicating whether the client may be allowed to redirect to another URL. Used to override a cached redirection request. When the user bookmarks or tries to go to a URL without logging in, S/Web will cache the request and send them there after a successful login. If the programmer wishes to override this redirect they must set NOREDIRECT to True$ | | TIMEOUT | Get/Set | Time in minutes that a client is allowed to be active before being timed out. By default set to contents of wwwSvrEnvRec@<WWWCFG_CLIENT_TIMEOUT$>. | | UNAUTHORIZED | Get/Set | Indicated if the client failed the login request | | VALID | Get/Set | True if this client is valid. Note that if you are using ANONYMOUSPROCS you should use this in conjunction with the ANONYMOUS property as whilst the client is using an anonymous procedure VALID will still be set to true. | | XVERSION | Get | Contains the current S/Web version |
See Chapter 4, Security, for more information on the authentication and anonymous properties Methods: call www_Exec_Method( "CLIENT", method, param1, param2, param3, param4, param5) | Method | Description |
|---|
| CREATE | Creates the client object. | | DESTROY | Destroys the current object. | | GET | Retrieves properties of the current client object. | | GETHEADER | Retrieves the header of the current client object. | | ISEXPIRED | Checks to see if a client has expired. | | PURGE | Purges the system cache | | SET | Sets properties of the current client object. |
[top] 
This method creates the CLIENT object. This is automatically called by S/Web and should not be called by the developer. | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
[top] 
This method destroys the current client. Calling this method will require that the current session logs in again. | Argument | Description |
|---|
| param1 | The client ID to destroy. Defaults to current client if none specified. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical CurrentTime = Time() * If time is after 5:00pm local time, then logout the current user If CurrentTime > 61200 Then if www_Exec_Method( "CLIENT", "DESTROY", "", "", "", "", "", "", errorText ) then clientHeader<WWW_CLIENT$AUTHENTICATED$> = FALSE$ end else abort = TRUE$ end end [top] 
ISEXPIRED method This method checks to see if a client has expired. | Argument | Description |
|---|
| param1 | A client number (defaults to current client) | | param2 | Returns TRUE$ if the client is expired. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical if www_Exec_Method( "CLIENT", "ISEXPIRED", isExp, "", "", "", "", "", errorText ) then If isExp Then docID = "EXPIRED" end else docID = "VALID" end end else abort = TRUE$ end [top] 
This method allows you to retrieve properties from the client object. | Argument | Description |
|---|
| param1 | An @RM list of properties to retrieve | | param2 | An @RM list of retrieved property values. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical Properties = "NAME" Properties := @RM : "DATA" if www_Exec_Method( "CLIENT", "GET", Properties, RetVals, "", "", "", "", errorText ) then UserName = Field( RetVals, @RM, 1 ) UserData = Field( RetVals, @RM, 2 ) end else abort = TRUE$ end [top] 
This method returns the client header from the cache. If no client is passed, the current client is assumed. | Argument | Description |
|---|
| param1 | The client ID whose header you wish to retrieve | | param2 | The client header is returned in this parameter. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical if www_Exec_Method( "CLIENT", "GETHEADER", "", ClientHeader, "", "", "", "", errorText ) then null end else abort = TRUE$ end [top] 
This function purges the client cache table | Argument | Description |
|---|
| param1 | Not used. | | param2 | Not used. | | param3 | Not used. | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical if www_Exec_Method( "CLIENT", "PURGE", "", "", "", "", "", "", errorText ) then null end else abort = TRUE$ end [top] 
This method allows you to set properties of the client object | Argument | Description |
|---|
| param1 | An @RM list of properties to retrieve | | param2 | An @RM list of retrieved property values. | | param3 | An @RM list of the original property values | | param4 | Not used. | | param5 | Not used. |
Example: declare function www_Exec_Method, www_Get_Status, www_Set_Status $insert www_Status_Equates $insert logical Properties = "NAME" Properties := @RM : "DATA" Values := "Homer Simpson" Values := "Springfield" : @FM : "Sector 7G" if www_Exec_Method( "CLIENT", "SET", Properties, Values, OrigValues, "", "", "", errorText ) then OrigUserName = Field( OrigValues, @RM, 1 ) OrigUserData = Field( OrigValues, @RM, 2 ) end else abort = TRUE$ end [top] 
|  |  |  |