src/AdminStoreInit.php
protected function store_redis_cache_write(
		$token, $data, $expire_at, $expire=null
	) {
		if (!$this->redis)
			return;

		$key = sprintf('%s:%s', $this->token_name, $token);
		$this->redis->set($key, json_encode($data));

		if ($expire === null) {
			$expire_at = str_replace(' ', 'T', $expire_at) . 'Z';
			$expire_at = \DateTime::createFromFormat(
				\DateTime::ATOM, $expire_at)->format("U");
			$expire = $expire_at;
		}
		$this->redis->expire($key, $expire);

		$this->logger->debug(sprintf(
			"Zapmin: session written to cache: '%s' <- '%s'.",
			$token, json_encode($data)));
	}
protected function store_redis_cache_write(
		$token, $data, $expire_at, $expire=null
	) {
		if (!$this->redis)
			return;

		$key = sprintf('%s:%s', $this->token_name, $token);
		$this->redis->set($key, json_encode($data));

		if ($expire === null) {
			$expire_at = str_replace(' ', 'T', $expire_at) . 'Z';
			$expire_at = \DateTime::createFromFormat(
				\DateTime::ATOM, $expire_at)->format("U");
			$expire = $expire_at;
		}
		$this->redis->expire($key, $expire);

		$this->logger->debug(sprintf(
			"Zapmin: session written to cache: '%s' <- '%s'.",
			$token, json_encode($data)));
	}
protected function store_redis_cache_write ( $ token , $ data , $ expire_at , $ expire = null ) { if ( ! $ this -> redis ) return ; $ key = sprintf ( '%s:%s' , $ this -> token_name , $ token ) ; $ this -> redis -> set ( $ key , json_encode ( $ data ) ) ; if ( $ expire === null ) { $ expire_at = str_replace ( ' ' , 'T' , $ expire_at ) . 'Z' ; $ expire_at = \ DateTime :: createFromFormat ( \ DateTime :: ATOM , $ expire_at ) -> format ( "U" ) ; $ expire = $ expire_at ; } $ this -> redis -> expire ( $ key , $ expire ) ; $ this -> logger -> debug ( sprintf ( "Zapmin: session written to cache: '%s' <- '%s'." , $ token , json_encode ( $ data ) ) ) ; }
Write session to cache.

@param string $token Session token.
@param array $data User data.
@param string $expire_at Redis expireat parameter, in UTC
datetime.
@param int $expire Redis expire parameter, in seconds. If this
is set, $expire_at is ignored.
Write session to cache .