devp-eu/tmcms-module-sessions

Module Sessions for TMCms

dev-master 2017-08-06 20:17 UTC

This package is not auto-updated.

Last update: 2024-04-12 20:19:00 UTC


README

Usage:

Check session

$session = ModuleSessions::check();

$session will be false or instance of SessionEntity class

Start session, example with ModuleClients

// Check supplied client data
$client = ModuleClients::checkAuthAndGetClient($email, $password);
if ($client) {
    // Start session and store logged-in user's ID
    ModuleSessions::start($client->getId(), $some_additional_data);
}

One of the most useful new functions is kicking other client's session to prevent multiple log-ins with one account

// Remove all old client's sessions to kick all previous log-ins
ModuleSessions::deleteAllClientSessions($client);