set cookie, get file before handshake