Unable to use ALL cookies from webpage in my background script - [Safari App Extension]

Hi All. I am building a safari app extension which needs to make several HTTP requests from the background script. The HTTP requests need to use the Cookies that exist on my webpage.

When I make the requests from my background script, I see 3 of my 4 cookies are added to the request cookie header, but the 4th cookie is not there. The 4th cookie has SameSite=Lax which seems to be the issue. When I manually change Lax to none, in my webpage's cookie storage, then the request goes through successfully from my background script.

Does anyone know if there is a way to get/use cookies labeled as SameSite=Lax in my background script? I tried the broswer.cookies API, but it seems that the API will only retrieve non HttpOnly cookies, and my cookie has HttpOnly enabled as well, so this does not work.

How can I make requests from my background script that need to use cookies from my webpage?

P.S. This works in my chrome extension just fine, but it seems Safari has some restrictions

Thanks in Advance :)

Hi, I know this is a 1-year-old post, but have you found a solution to this problem?

I'm currently dealing with a similar issue but with SameSite=Strict attribute, and the cookie isn't set.

I don't want to set SameSite=None so I'm left looking for alternatives.

Thanks.

I have the same issue and found no solution yet. But at least Mac OS Ventura Beta stopped deleting the cookies from the browser when the extension fails to get them. So there is some progress there, but the bug is still not solved.

Hi @kichik you may have to use a content script to bypass this restriction

Unable to use ALL cookies from webpage in my background script - [Safari App Extension]
 
 
Q