Session
extends SessionHandler
in package
Manage user session with encryption, access verification, headers and lifetime session
Table of Contents
Properties
- $encryptMethod : string
- $secretKey : string
Methods
- __construct() : void
- Construct the Session object with env key a secrets key
- createSession() : mixed
- decryptSessionId() : string
- Dencrypt the session's id
- disableSession() : void
- Disable a session
- encryptSessionId() : string
- Encrypt the session's id on sha256
- getInfosSession() : string
- Get the id of a session
- regenSession() : bool
Properties
$encryptMethod
private
string
$encryptMethod
= "AES-256-CBC"
$secretKey
private
string
$secretKey
Methods
__construct()
Construct the Session object with env key a secrets key
public
__construct(mixed $userId, mixed $userName, mixed $userAccessCode) : void
Parameters
- $userId : mixed
- $userName : mixed
- $userAccessCode : mixed
createSession()
public
createSession(mixed $userId, mixed $userName, mixed $userAccessCode) : mixed
Parameters
- $userId : mixed
- $userName : mixed
- $userAccessCode : mixed
decryptSessionId()
Dencrypt the session's id
public
decryptSessionId(mixed $data) : string
Parameters
- $data : mixed
Return values
string —Return the key decreypted
disableSession()
Disable a session
public
static disableSession() : void
Return values
void —Nothing...?
encryptSessionId()
Encrypt the session's id on sha256
public
encryptSessionId(int $id) : string
Parameters
- $id : int
Return values
string —Return the key encreypted
getInfosSession()
Get the id of a session
public
getInfosSession() : string
Return values
string —session id or an error if session is not set (user not connected)
regenSession()
public
static regenSession(int $ASessionId) : bool
Parameters
- $ASessionId : int
-
the identifiant of session
Return values
bool —return true if it succes, else false