Logic for saving handshake data to the redis database