5 include_once
'./Services/Authentication/classes/class.ilSession.php';
47 if (self::$instance) {
48 return self::$instance;
50 return self::$instance =
new self(
$logger);
69 $this->
setId(session_id());
77 $this->authenticated = (int)
ilSession::get(self::SESSION_AUTH_AUTHENTICATED);
81 $this->
getLogger()->debug(
'Started new session.');
83 $this->expired =
false;
84 $this->authenticated =
false;
103 $old_session_id = session_id();
104 session_regenerate_id(
true);
105 $this->
setId(session_id());
106 $this->
getLogger()->info(
'Session regenerate id: [' . substr($old_session_id, 0, 5) .
'] -> [' . substr($this->
getId(), 0, 5) .
']');
116 session_regenerate_id(
true);
135 $this->authenticated = $a_status;
136 $this->user_id = $a_user_id;
160 $this->expired = $a_status;
170 $this->user_id = $a_id;
setAuthenticated($a_status, $a_user_id)
Set authenticated.
logout()
Logout user => stop session.
regenerateId()
Regenerate id.
isExpired()
Check if current is or was expired in last request.
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
isAuthenticated()
Check if session is authenticated.
const SESSION_AUTH_AUTHENTICATED
setExpired($a_status)
Set session expired.
const SESSION_AUTH_USER_ID
getUserId()
Get authenticated user id.
init()
Start auth session.
const SESSION_AUTH_EXPIRED
setUserId($a_id)
Set authenticated user id.
static lookupExpireTime($a_session_id)
Lookup expire time for a specific session ilDB $ilDB.
isValid()
Check if current session is valid (authenticated and not expired)
validateExpiration()
Check expired value of session.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static getInstance(\ilLogger $logger)
Get instance.
Component logger with individual log levels by component id.
__construct(\ilLogger $logger)
Consctructor.