ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ExtendIdPSession.php
Go to the documentation of this file.
1 <?php
2 
7 
8  public function process(&$state) {
9  assert(is_array($state));
10 
11  if (empty($state['Expire']) || empty($state['Authority'])) {
12  return;
13  }
14 
15  $now = time();
16  $delta = $state['Expire'] - $now;
17 
19  $sessionDuration = $globalConfig->getInteger('session.duration', 8*60*60);
20 
21  // Extend only if half of session duration already passed
22  if ($delta >= ($sessionDuration * 0.5)) {
23  return;
24  }
25 
26  // Update authority expire time
28  $session->setAuthorityExpire($state['Authority']);
29 
30  /* Update session cookies duration */
31 
32  /* If remember me is active */
33  $rememberMeExpire = $session->getRememberMeExpire();
34  if (!empty($state['RememberMe']) && $rememberMeExpire !== NULL && $globalConfig->getBoolean('session.rememberme.enable', FALSE)) {
35  $session->setRememberMeExpire();
36  return;
37  }
38 
39  /* Or if session lifetime is more than zero */
41  $cookieParams = $sessionHandler->getCookieParams();
42  if ($cookieParams['lifetime'] > 0) {
43  $session->updateSessionCookies();
44  }
45  }
46 
47 }
$session
Extend IdP session and cookies.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
static getSessionHandler()
This function retrieves the current instance of the session handler.
$globalConfig
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:241
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.