Added ready and pause events and stored token in cookie