tce_functions_session.php

User-level session storage functions.<br> This script uses the session_set_save_handler() function to set the user-level session storage functions which are used for storing and retrieving data associ

Source: shared/code/tce_functions_session.php

User-level session storage functions.<br> This script uses the session_set_save_handler() function to set the user-level session storage functions which are used for storing and retrieving data associated with a session.<br> The session data is stored on a local database. NOTE: This script automatically starts the user’s session.

Functions

checkCSRFToken()

Check the CSRF token

function checkCSRFToken(mixed $token): bool

Parameters:

  • $token (mixed): (string) tocken to check

Returns: bool

Source: shared/code/tce_functions_session.php:333

checkPassword()

Verifies that a password matches a hash

function checkPassword(mixed $password, mixed $hash): bool

Parameters:

  • $password (mixed): (string) The password to verify
  • $hash (mixed): (string) Password hash

Returns: bool

Source: shared/code/tce_functions_session.php:290

F_getCSRFToken()

Generate CSRF token

function F_getCSRFToken(): string

Returns: string

Source: shared/code/tce_functions_session.php:343

F_isRandomSecurityConfigured()

Returns true when K_RANDOM_SECURITY has been set to a unique per-installation secret, i.e. it is not empty and not one of the values shipped in config.default.

Security-sensitive checks that rely on the secrecy of K_RANDOM_SECURITY (e.g. the result-access token that bypasses the normal authorization check) MUST fail closed when this returns false, otherwise an attacker who knows the public default can forge a valid token. The installer replaces the placeholder with a random value at install time.

function F_isRandomSecurityConfigured(mixed $secret = null): bool

Parameters:

  • $secret (mixed)

Returns: bool: true if the seed is configured, false if it is still the shipped default.

Source: shared/code/tce_functions_session.php:304

F_session_string_to_array()

Convert encoded session string data to array.

function F_session_string_to_array(mixed $sd): array

Parameters:

  • $sd (mixed): (string) input data string

Returns: array

Source: shared/code/tce_functions_session.php:212

getClientFingerprint()

Generate a client fingerprint (unique ID for the client browser)

function getClientFingerprint(): string

Returns: string: client ID

Source: shared/code/tce_functions_session.php:232

getNewSessionID()

Generate and return a new session ID.

function getNewSessionID(): string

Returns: string: PHPSESSID

Source: shared/code/tce_functions_session.php:268

getPasswordHash()

Hash password for Database storing.

function getPasswordHash(mixed $password): string

Parameters:

  • $password (mixed): (string) Password to hash.

Returns: string: password hash

Source: shared/code/tce_functions_session.php:278

getPlainCSRFToken()

Generate unencoded CSRF token string

function getPlainCSRFToken(): string

Returns: string

Source: shared/code/tce_functions_session.php:321