sendEvent cookie null terminator

add null terminator to the received cookie