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)

I don't know this might be related or not. But similar problems has occurred here: https://forums.developer.apple.com/forums/thread/764279.

Not through Cookie API, fetch() API also can't include cookie which is possible in macOS 17.

Same issue here

Get cookies - Safari web extension macOS 18.1
 
 
Q