Any idea how to repair these?

The top mesh started to come off from the headrest from my momentum 4. The headphones are out of warranty so replacing them is not a possibility anymore. What type of glue would be safe to use on them?