public function handler_write($id, $data) {
        if (is_null($this->connection)) {
            // The session has already been closed, don't attempt another write.
            error_log('Tried to write session: '.$id.' before open or after close.');
            return false;
        }

        // We do not do locking here because memcached doesn't.  Also
        // PHP does open, read, destroy, write, close. When a session doesn't exist.
        // There can be race conditions on new sessions racing each other but we can
        // address that in the future.
        try {
            $this->connection->setex($id, $this->timeout, $data);
        } catch (RedisException $e) {
            error_log('Failed talking to redis: '.$e->getMessage());
            return false;
        }
        return true;
    }
public function handler_write($id, $data) {
        if (is_null($this->connection)) {
            // The session has already been closed, don't attempt another write.
            error_log('Tried to write session: '.$id.' before open or after close.');
            return false;
        }

        // We do not do locking here because memcached doesn't.  Also
        // PHP does open, read, destroy, write, close. When a session doesn't exist.
        // There can be race conditions on new sessions racing each other but we can
        // address that in the future.
        try {
            $this->connection->setex($id, $this->timeout, $data);
        } catch (RedisException $e) {
            error_log('Failed talking to redis: '.$e->getMessage());
            return false;
        }
        return true;
    }
public function handler_write ( $ id , $ data ) { if ( is_null ( $ this -> connection ) ) { // The session has already been closed, don't attempt another write. error_log ( 'Tried to write session: ' . $ id . ' before open or after close.' ) ; return false ; } // We do not do locking here because memcached doesn't.  Also // PHP does open, read, destroy, write, close. When a session doesn't exist. // There can be race conditions on new sessions racing each other but we can // address that in the future. try { $ this -> connection -> setex ( $ id , $ this -> timeout , $ data ) ; } catch ( RedisException $ e ) { error_log ( 'Failed talking to redis: ' . $ e -> getMessage ( ) ) ; return false ; } return true ; }
Write the serialized session data to our session store.

@param string $id session id to write.
@param string $data session data
@return bool true on write success, false on failure
Write the serialized session data to our session store .