class Session (View source)

The Session model class provides all methods related to a user session.

Methods

static 
clearResetTokenHash()

Clears the reset token hash

static string
getResetTokenHash(string $username)

Return the reset token hash for a given user.

static string
getUsername()

Return the currently logged in user.

static bool
login(string $nameOrEmail, string $password)

Verify login information based on $_POST.

static bool
logout()

Log out user.

static 
setResetTokenHash(string $username, string $tokenHash)

Set the reset token hash for a given user.

Details

static clearResetTokenHash()

Clears the reset token hash

static string getResetTokenHash(string $username)

Return the reset token hash for a given user.

Parameters

string $username

Return Value

string the token hash

static string getUsername()

Return the currently logged in user.

Return Value

string Username

static bool login(string $nameOrEmail, string $password)

Verify login information based on $_POST.

Parameters

string $nameOrEmail
string $password

Return Value

bool false on error

static bool logout()

Log out user.

Return Value

bool true on success

static setResetTokenHash(string $username, string $tokenHash)

Set the reset token hash for a given user.

Parameters

string $username
string $tokenHash