public static function decodeToken($token) {
        global $CFG;
        $plain = AesCtr::decrypt($token, $CFG->websocket_secret, 256) ;
        $pieces = explode('::', $plain);
        if ( count($pieces) != 4 ) return false;
        return $plain;
    }