# new UBSession ()

Members

# authSchema : string instance

Name of authentication schema

# userData : object instance

Contain custom user data. Usually filled inside server onUserLogon event handlers

Do not use it directly, instead use helper method SyncConnection.userData() instead.

Methods

# authHeader (authMockoptboolean) → string instance

Return authorization header

Arguments:
  
      $App.connection.authorize().then(function(session){
  return {Authorization: session.authHeader()}
})
  

# crc32 (sstring, polynomialoptnumber, initialValueoptnumber, finalXORValueoptnumber) → number instance

Calculate CRC32 checksum for UTF8 string representation

Arguments:
  • s: string

    string to calculate CRC32

  • polynomial: number

    polynomial basis. default to 0x04C11DB7

  • initialValue: number

    initial crc value. default to 0xFFFFFFFF

  • finalXORValue: number

    default to 0xFFFFFFFF

# hexa8 (valuestring) → string instance

Return hexadecimal string of 8 character length from value

Arguments:

# isAnonymous () → boolean instance

Current session is anonymous session

# signature (authMockoptboolean) → string instance

Session signature for authorized request. Can be added as LAST parameter in url, or to Authorization header (preferred way)

Arguments:
  
      $App.connection.authorize().then(function(session) {
       // for URL
       return 'session_signature=' + session.signature()
       //for header
       return { Authorization: session.authSchema + ' ' + session.signature() }
   })