Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Logcat showing issues with cookiemanager.cc unable to set secure cookies #1906

Open
1 task done
mariusbolik opened this issue Nov 9, 2023 · 5 comments
Open
1 task done

Comments

@mariusbolik
Copy link

mariusbolik commented Nov 9, 2023

What happened?

Hello,

I am seeing this error in logcat:

[ERROR:cookie_manager.cc(135)] Strict Secure Cookie policy does not allow setting a secure cookie for http://onesignal.com/ for apps targeting >= R. Please either use the 'https:' scheme for this URL or omit the 'Secure' directive in the cookie value.

Are there some HTTP Requests not running through https?

Steps to reproduce?

I'm using Capacitor, but I think the Issue still belongs here. The problem was also mentioned in this issue: https://github.com/OneSignal/OneSignal-Android-SDK/issues/1873
I set CapacitorHttp and CapacitorCookies enabled. But I am not sure if this has an effect on the error:

const config: CapacitorConfig = {
  ...
  server: {
    androidScheme: 'https'
  },
  plugins: {
    SplashScreen: {
      launchAutoHide: false
    },
    CapacitorCookies: {
      enabled: true,
      androidCustomSchemeAllowInsecureAccess: true,
    },
    CapacitorHttp: {
      enabled: true,
    }
  }
};

What did you expect to happen?

I would expect the SDK to set cookies correctly or make requests through https.

OneSignal Android SDK version

5.0.3

Android version

13

Specific Android models

Samsung Galaxy s52 5G

Relevant log output

[ERROR:cookie_manager.cc(135)] Strict Secure Cookie policy does not allow setting a secure cookie for http://onesignal.com/ for apps targeting >= R. Please either use the 'https:' scheme for this URL or omit the 'Secure' directive in the cookie value.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@mariusbolik thank you for reaching out! We are investigating and will get back to you as soon as possible.

@jmonloop
Copy link

jmonloop commented Feb 8, 2024

Hello, is there any update about this one?

@nan-li
Copy link
Contributor

nan-li commented Feb 8, 2024

Making a note for investigating this issue that the SDK makes requests to https://api.onesignal.com/. This is probably from a webview's html.

@jmonloop
Copy link

jmonloop commented Feb 9, 2024

Hello. Any update about this one?

@ernes128
Copy link

ernes128 commented May 8, 2024

If this helps anybody, I was able to solve it modfying the capacitor.config.ts file and putting the androidScheme into https like this

  server: {
    androidScheme: 'https',
  }

And then in the AndroidManifest, removing the clearTextTraffic attribute. Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants