Session Attributes

Standard Attributes

PrivateSurferAttributesOK Comma-delimited list of private surfer attributes which are OK to be viewed in this session. By default all private surfer attributes which are set in this session are added to this list, and thus readable.

Surfer Attributes

Standard Attributes

BadLoginAttempts Number of bad login attempts for this surfer today.
LastLoginDateTime Date and time of the most recent explicit login.
PreviousLoginDateTime Date and time of the login before the last login.
SuccessfulLogins Date and time of the login before the last login.

Functions

createSurfer() { lib/surffuncs.i }

createSurfer()

Used only within webstate.i, this function should probably not be used elsewhere. It creates a new WebSurfer record for any given session that does not have a webSurfer associated.

Returned Value

Logical - (True if created correctly, False if there was an error creating.)

Parameters

None

See Also:

newSurfer() Function


deleteSessionAttribute() { lib/surffuncs.i }

deleteSessionAttribute(attributeName)

Deletes the named attribute from the current session's context.

Returned Value

Logical - (True if deleted or non-existent, False if not deleted.)

Parameters

attributeName - Name of the attribute to delete (Character)


deleteSurferAttribute() { lib/surffuncs.i }

deleteSurferAttribute(attributeName)

Deletes the named attribute from the current surfer's profile

Returned Value

Logical - (True if deleted or non-existent, False if not deleted, ? if surfer not available)

Parameters

attributeName - Name of the attribute to delete (Character)


digitsOnly() { lib/usifuncs.i }

digitsOnly(stringValue)

Strips ALL non-numeric characters from a string, including decimals and commas. This function does not modify the value of stringValue. It only returns the modified value. Used for removing formatting characters from phone numbers, credit card numbers, etc. Also can be used when casting a string into an integer to assure that the operation does not throw an error.

Returned Value

Character - A string consisting of only the digits (0-9) which were in the stringValue.

Parameters

stringValue - Any string. (Character)


domainName() { lib/webstate.i }

domainName(URLString)

Parses out and returns the domain name of the URL string passed in.

Returned Value

Character - A string consisting of only the domain name portion of the URL.

Parameters

URLString - Any corretly formed URL. (Character)


errorLog() { lib/usiweb.i }

errorLog(logText)

If -weblogerror is in the WebSpeed agents' startup parameters, this function will write an entry in the WebSpeed error log for that broker. The note uses this format:


Note that the name of the object is determined by the name of the WEB-FILE preprocessor which is defined in the top of the webobject. WebSpeed marks the note with its own date and time stamp.

Returned Value

Logical - (Always true)

Parameters

logText - The text that you would like to place in the logfile. (Character)

Example

errorLog("User attempted login to non-existent account: " + accountid).

See Also:

logNote() Function


getSessionAttribute() { lib/surffuncs.i }

getSessionAttribute(attributeName)

Returns a character value corresponding to the attributeValue of the current session's attribute specified by attributeName

Returned Value

Character - (Current value of the attribute or null if not found)

Parameters

attributeName - Name of the attribute to retrieve (Character)


getSurferAttribute() { lib/surffuncs.i }

getSurferAttribute(attributeName)

Returns a character value corresponding to the attributeValue of the current surfer's attribute specified by attributeName

Returned Value

Character - (Current value of the attribute or ? if surfer not available, or null if not found)

Parameters

attributeName - Name of the attribute to retrieve (Character)


incrementSurferAttribute() { lib/surffuncs.i }

incrementSurferAttribute(attributeName,expireDate)

If the value of the current surfer's attribute specified contains the character representation of a valid integer, then the value is incremented by 1, and returned.

Returned Value

Integer - (New integer value of the attribute)

Parameters

attributeName - Name of the attribute to increment (Character)
expireDate - Date on which the attribute will no longer be effective (Date)


listSurferAttributes() { lib/surffuncs.i }

listSurferAttributes(attributeType)

Returns a list of all of the attribute names associated with the current surfer.

Returned Value

Character - (Comma-delimited list of attribute names)

Parameters

attributeType - Which types of attribute names to return (Character)


lockSession() { lib/webstate.i }

lockSession()

Gets the current WebSession and thisWebHit buffer exclusive-locked.

Returned Value

Character - (Null)

Example

DO TRANSACTION:
	lockSession().
	assign
	 webSession.zz-char1 = "Hello"
	 thisWebHit.zz-char1 = "World"
	.
	unLockSession().
END. /*transaction*/

See Also:

unLockSession() Function


logNote() { lib/webstate.i }

logNote(noteType,noteText)

Makes a note in the logNote field of the current webHit buffer.

Returned Value

Logical - (True if thisWebHit buffer was available, False if not.)

Parameters

noteType - A word describing the level of urgency for this note. (Character)

Currently used values:
noteText - Actual text of the note. Be as descriptive as practical. (Character)

Example

logNote("Caution","User attempted login to non-existent account: " + accountid).

See Also:

errorLog() Function


newSurfer() { lib/surffuncs.i }

newSurfer()

Makes a new blank webSurfer record and returns its new WebSurferID.

Returned Value

Character - (The websurferID of the new record created)

Parameters

None

See Also:

createSurfer() Function


push() { lib/usifuncs.i }

push(targetlist,sourcelist)

Adds the items in sourcelist to the items in targetlist and returns the combined list. This function does not modify the original targetlist. If a list item exists in both lists, then the item will retain its original position in the targetlist. Otherwise new list items will be added to the end of the targetlist in the same order in which they are listed in sourcelist.

Returned Value

Character - (The new combined list)

Parameters

targetlist - Original list (Character)
sourcelist - New list to be merged with original list (Character)


pushSessionAttribute() { lib/surffuncs.i }

pushSessionAttribute(attributeName,newListItems)

Adds the items from newListItems to the attribute listed by attributeName. See the push() function for more information about how the lists are combined.

Returned Value

Logical - (True if the lists were added correctly)

Parameters

attributeName - Name of the attribute to which this list will be added (Character)
newListItems - List of values to be added to the Attribute's value using the push() function (Character)


pushSurferAttribute() { lib/surffuncs.i }

pushSurferAttribute(attributeName,newListItems,expireDate)

Adds the items from newListItems to the attribute listed by attributeName. See the push() function for more information about how the lists are combined.

Returned Value

Logical - (True if the lists were added correctly)

Parameters

attributeName - Name of the attribute to which this list will be added (Character)
newListItems - List of values to be added to the Attribute's value using the push() function (Character)
expireDate - Date on which the attribute will no longer be effective. An unknown (?) value makes the attribute non-expiring (Date)


setPrivateSurferAttribute() { lib/surffuncs.i }

setSurferAttribute(attributeName,attributeValue,expireDate)

Set's the current surfer's given attribute to the value you specify, to expire on the date you specify. The Attribute will be a "private" attribute, meaning that it can only be returned in the same session it was set, or in subsequent sessions only when the surfer has been verified using the verifySurfer() function. If a program attempts to retrieve a private attribute using the getAttribute() function, and the surfer is not verified, and it is a subsequent session from when it was set, that function will return null.

Returned Value

Logical - (True if the attribute was set correctly)

Parameters

attributeName - Name of the attribute to set (Character)
attributeValue - Value of the attribute (Character)
expireDate - Date on which this attribute will no longer be effective (Date)


setSessionAttribute() { lib/surffuncs.i }

setSessionAttribute(attributeName,attributeValue)

Set's the current session's given attribute to the value you specify. Note that values saved in session attributes are transient, and are deleted whenever the session is deleted.

Returned Value

Logical - (True if the attribute was set correctly)

Parameters

attributeName - Name of the attribute to set (Character)
attributeValue - Value of the attribute (Character)


setSurferAttribute() { lib/surffuncs.i }

setSurferAttribute(attributeName,attributeValue,expireDate)

Set's the current surfer's given attribute to the value you specify, to expire on the date you specify.

Returned Value

Logical - (True if the attribute was set correctly)

Parameters

attributeName - Name of the attribute to set (Character)
attributeValue - Value of the attribute (Character)
expireDate - Date on which this attribute will no longer be effective (Date)


switchSurfer() { lib/surffuncs.i }

switchSurfer(newSurferID)

Switches the current webSession's associated webSurfer to the one that matches the ID passed in in newSurferID.

Returned Value

Logical - (True if the surfer was switched correctly)

Parameters

newSurferID - WebSurferID of the WebSurfer to which this WebSession will be changed. (Character)


unLockSession() { lib/webstate.i }

unLockSession()

Gets the current WebSession and thisWebHit buffer with no-lock.

Returned Value

Character - (Null)

Example

DO TRANSACTION:
	lockSession().
	assign
	 webSession.zz-char1 = "Hello"
	 thisWebHit.zz-char1 = "World"
	.
	unLockSession().
END. /*transaction*/

See Also:

lockSession() Function


verifySurfer() { lib/surffuncs.i }

verifySurfer()

Sets the current session to note that the surfer is verified as explicitly logged in. The session reflects its best guess of who the surfer is, immediately on the first hit of the session. However, to access private attributes of the surfer, the surfer must be explicitly logged in. After verifying the surfer's password from a login screen, use this function to mark the session record as such.

Returned Value

Logical - (True if the session was marked correctly)

Parameters

-- None --