Exemplo n.º 1
0
 /**
  * Create the session handler.
  *
  * @param Config $config The session config
  */
 public function __construct(Config $config)
 {
     $this->config = $config;
     // Convert the config object into one the cache understands
     $cacheConfig = new CacheConfig($config->toArray());
     // Create the cache instance for use in reading/writing session data
     $this->storage = new CacheInstance('pug_session_storage', $cacheConfig);
     if (Cookie::get($config->cookie_name) === null) {
         $this->generateId();
     }
 }
Exemplo n.º 2
0
 public function __construct($cipher = MCRYPT_RIJNDAEL_256)
 {
     $this->cipher = mcrypt_module_open($cipher, '', 'cbc', '');
     $this->key = Config::get('app.secret');
 }