/** * 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(); } }
public function __construct($cipher = MCRYPT_RIJNDAEL_256) { $this->cipher = mcrypt_module_open($cipher, '', 'cbc', ''); $this->key = Config::get('app.secret'); }