files-shared-code-tce-functions-session

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

tce_functions_session.php

Tags
file

User-level session storage functions.
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.
The session data is stored on a local database. NOTE: This script automatically starts the user's session.

author

Nicola Asuni

since
2001-09-26

Table of Contents

Functions

F_session_open()  : bool
Open session.
F_session_close()  : bool
Close session.<br> Call garbage collector function to remove expired sessions.
F_session_read()  : string
Get session data.
F_session_write()  : resource
Insert or Update session.
F_session_destroy()  : resource
Deletes the specific session.
F_session_gc()  : int
Garbage collector.<br> Deletes expired sessions.<br> NOTE: while time() function returns a 32 bit integer, it works fine until year 2038.
F_session_string_to_array()  : array<string|int, mixed>
Convert encoded session string data to array.
getClientFingerprint()  : string
Generate a client fingerprint (unique ID for the client browser)
getNewSessionID()  : string
Generate and return a new session ID.
getPasswordHash()  : string
Hash password for Database storing.
checkPassword()  : bool
Verifies that a password matches a hash
getPlainCSRFToken()  : string
Generate unencoded CSRF token string
checkCSRFToken()  : bool
Check the CSRF token
F_getCSRFToken()  : string
Generate CSRF token

Functions

F_session_open()

Open session.

F_session_open( $save_path,  $session_name) : bool
Parameters
$save_path :

(string) path were to store session data

$session_name :

(string) name of session

Return values
bool

always TRUE

F_session_close()

Close session.<br> Call garbage collector function to remove expired sessions.

F_session_close() : bool
Return values
bool

always TRUE

F_session_read()

Get session data.

F_session_read( $key) : string
Parameters
$key :

(string) session ID.

Return values
string

session data.

F_session_write()

Insert or Update session.

F_session_write( $key,  $val) : resource
Parameters
$key :

(string) session ID.

$val :

(string) session data.

Return values
resource

database query result.

F_session_destroy()

Deletes the specific session.

F_session_destroy( $key) : resource
Parameters
$key :

(string) session ID of session to destroy.

Return values
resource

database query result.

F_session_gc()

Garbage collector.<br> Deletes expired sessions.<br> NOTE: while time() function returns a 32 bit integer, it works fine until year 2038.

F_session_gc() : int
Return values
int

number of deleted sessions.

F_session_string_to_array()

Convert encoded session string data to array.

F_session_string_to_array( $sd) : array<string|int, mixed>
Parameters
$sd :

(string) input data string

Tags
author

Nicola Asuni

since
2001-10-18
Return values
array<string|int, mixed>

getClientFingerprint()

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

getClientFingerprint() : string
Tags
author

Nicola Asuni

since
2010-10-04
Return values
string

client ID

getNewSessionID()

Generate and return a new session ID.

getNewSessionID() : string
Tags
author

Nicola Asuni

since
2010-10-04
Return values
string

PHPSESSID

getPasswordHash()

Hash password for Database storing.

getPasswordHash( $password) : string
Parameters
$password :

(string) Password to hash.

Return values
string

password hash

checkPassword()

Verifies that a password matches a hash

checkPassword( $password,  $hash) : bool
Parameters
$password :

(string) The password to verify

$hash :

(string) Password hash

Return values
bool

getPlainCSRFToken()

Generate unencoded CSRF token string

getPlainCSRFToken() : string
Return values
string

checkCSRFToken()

Check the CSRF token

checkCSRFToken( $token) : bool
Parameters
$token :

(string) tocken to check

Return values
bool
On this page
 

© 2004-2024 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy