Get cookies - Safari web extension macOS 18.1

I have a macOS safari web extension and It can read the cookies of my website, but when I fully close safari and open it again the extension can't read the cookies anymore. When I try to inspect the cause in the console (safari > develop > web extension background content) everything starts to work again.

My safari version is 18.1 (19619.2.8.111.1, 19619)

Are you running the extension from the debugger? This can open a different Safari window which may not persist the cookies. If you deploy the app to the AppStore and this is still happening, it is surely a bug on our end.

The same issue applies here. I have already submitted feedback with code and steps to reproduce the bug.

FB15232764 (Safari web extension unable to use browser.cookies.get() to get cookies)

Get cookies - Safari web extension macOS 18.1
 
 
Q