public function set($type, $key, $value, $expire = null)
    {
        $redisKey = "{$this->prefix}.$type.$key";
        $this->redis->set($redisKey, serialize($value));

        if (is_null($expire)) {
            $expire = time() + $this->lifeTime;
        }
        $this->redis->expireat($redisKey, $expire);
    }
public function set($type, $key, $value, $expire = null)
    {
        $redisKey = "{$this->prefix}.$type.$key";
        $this->redis->set($redisKey, serialize($value));

        if (is_null($expire)) {
            $expire = time() + $this->lifeTime;
        }
        $this->redis->expireat($redisKey, $expire);
    }
public function set ( $ type , $ key , $ value , $ expire = null ) { $ redisKey = "{$this->prefix}.$type.$key" ; $ this -> redis -> set ( $ redisKey , serialize ( $ value ) ) ; if ( is_null ( $ expire ) ) { $ expire = time ( ) + $ this -> lifeTime ; } $ this -> redis -> expireat ( $ redisKey , $ expire ) ; }
Save a value to Redis

If no expiration time is given, then the expiration time is set to the
session duration.

@param string $type     The datatype
@param string $key      The key
@param mixed $value     The value
@param int|NULL $expire The expiration time (unix timestamp), or NULL if it never expires
Save a value to Redis