Ejemplo n.º 1
0
 /**
  * Initialize the session handler.
  *
  * This function creates an instance of the session handler which is
  * selected in the 'session.handler' configuration directive. If no
  * session handler is selected, then we will fall back to the default
  * PHP session handler.
  */
 private static function createSessionHandler()
 {
     $store = SimpleSAML_Store::getInstance();
     if ($store === FALSE) {
         self::$sessionHandler = new SimpleSAML_SessionHandlerPHP();
     } else {
         self::$sessionHandler = new SimpleSAML_SessionHandlerStore($store);
     }
 }
Ejemplo n.º 2
0
 /**
  * Initialize the session handler.
  *
  * This function creates an instance of the session handler which is
  * selected in the 'session.handler' configuration directive. If no
  * session handler is selected, then we will fall back to the default
  * PHP session handler.
  */
 private static function createSessionHandler()
 {
     /* Get the configuration. */
     $config = SimpleSAML_Configuration::getInstance();
     assert($config instanceof SimpleSAML_Configuration);
     /* Get the session handler option from the configuration. */
     $handler = $config->getString('session.handler', 'phpsession');
     $handler = strtolower($handler);
     switch ($handler) {
         case 'phpsession':
             $sh = new SimpleSAML_SessionHandlerPHP();
             break;
         case 'memcache':
             $sh = new SimpleSAML_SessionHandlerMemcache();
             break;
         default:
             throw new SimpleSAML_Error_Exception('Invalid session handler specified in the \'session.handler\'-option.');
     }
     /* Set the session handler. */
     self::$sessionHandler = $sh;
 }
Ejemplo n.º 3
0
 /**
  * Initialize the session handler.
  *
  * This function creates an instance of the session handler which is
  * selected in the 'session.handler' configuration directive. If no
  * session handler is selected, then we will fall back to the default
  * PHP session handler.
  */
 private static function createSessionHandler()
 {
     $store = SimpleSAML_Store::getInstance();
     if ($store === false) {
         self::$sessionHandler = new SimpleSAML_SessionHandlerPHP();
     } else {
         /** @var SimpleSAML_Store $store At this point, $store can only be an object */
         self::$sessionHandler = new SimpleSAML_SessionHandlerStore($store);
     }
 }
 public static function createSessionHandler()
 {
     global $SIMPLESAML_INCPREFIX;
     /* Get the configuration. */
     $config = SimpleSAML_Configuration::getInstance();
     assert($config instanceof SimpleSAML_Configuration);
     /* Get the session handler option from the configuration. */
     $handler = $config->getValue('session.handler', 'phpsession');
     assert('is_string($handler)');
     $handler = strtolower($handler);
     if ($handler === 'phpsession') {
         $sh = new SimpleSAML_SessionHandlerPHP();
     } else {
         if ($handler === 'memcache') {
             $sh = new SimpleSAML_SessionHandlerMemcache();
         } else {
             $e = 'Invalid value for the \'session.handler\'' . ' configuration option. Unknown session' . ' handler: ' . $handler;
             error_log($e);
             die($e);
         }
     }
     /* Set the session handler. */
     self::$sessionHandler = $sh;
 }