/** * Decrypt an array based cookie. * * @param array $cookie * @return array */ protected function decryptArray(array $cookie) { $decrypted = array(); foreach ($cookie as $key => $value) { $decrypted[$key] = $this->encrypter->decrypt($value); } return $decrypted; }
/** * Retrieve an item from the cache by key. * * @param string $key * @return mixed */ public function get($key) { $prefixed = $this->prefix . $key; $cache = $this->table()->where('key', '=', $prefixed)->first(); // If we have a cache record we will check the expiration time against current // time on the system and see if the record has expired. If it has, we will // remove the records from the database table so it isn't returned again. if (!is_null($cache)) { if (is_array($cache)) { $cache = (object) $cache; } if (time() >= $cache->expiration) { $this->forget($key); return null; } return $this->encrypter->decrypt($cache->value); } }