use localStorage in OWASP Zap

I am trying to test an application which store information in localStorage, so i use a script to by pass authentication and in need to store a token in localStorage but i have this error : localStorage is undefined. Is there any way to store information in localStorage in OWASP Zap?

Thank you.