Validate Sessions

Validate Sessions

You can check that users are genuine by validating sessions.

use Saturn\SessionManager\Authenticate;

$Authenticate = new Authenticate();

if ($Authenticate->Validate()) {
    // Valid session
} else {
    // Invalid session
}

Generate User Sessions

This function can be used to securely generate session tokens and store the user's username and UUID in session variables.

This does not check their credentials against the database, you MUST use the database system to do this.

use Saturn\SessionManager\Authenticate;

$Authenticate = new Authenticate();
$Authenticate->Generate($Username, $UUID)

Accessing session data

Sesssion data can be accessed like any usual session.

$Username = $_SESSION['Username'];
$UUID = $_SESSION['UUID'];
$Token = $_SESSION['Token'];

Last updated