Sets a callback that will be called when the session is timed out.
void set onTimeout(void callback());