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: Capacitor Cookies iOS separator #6311

Closed
OskarLebuda opened this issue Feb 20, 2023 · 2 comments
Closed

bug: Capacitor Cookies iOS separator #6311

OskarLebuda opened this issue Feb 20, 2023 · 2 comments
Labels

Comments

@OskarLebuda
Copy link

OskarLebuda commented Feb 20, 2023

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊

Latest Dependencies:

@capacitor/cli: 4.6.3
@capacitor/core: 4.6.3
@capacitor/android: 4.6.3
@capacitor/ios: 4.6.3

Installed Dependencies:

@capacitor/cli: 4.5.0
@capacitor/core: 4.5.0
@capacitor/android: 4.5.0
@capacitor/ios: 4.5.0

Platform(s)

iOS (Android and Web works fine)

Plugin:

CapacitorCookie

Current Behavior

The CapacitorCookies plugin for ios splits the cookies by ;. But the document.cookies has space between each one.
For example:
image

Some of the 3rd party library based on cookies split this string by ; with the space and CookiesManager does not return it correctly.
I think this is bug/not a bug becase for some reason the CookiesManager splits it like this by default.

Most popular libs like NPM Cookie also based on ; (with space).
Here is also the code of 3rd lib which we debugged and found the problem with CookieManager:
image

Expected Behavior

My proposal is to add to the CapacitorConfig (into Cookies plugin) new property like separator eg:

plugins: {
    CapacitorCookies: {
      enabled: true,
      separator: '; ',
    },
  },

to manage separator by your self.

The code with are responsible for this is here: https://github.com/ionic-team/capacitor/blob/main/ios/Capacitor/Capacitor/Plugins/CapacitorCookieManager.swift#L91

image

Code Reproduction

Other Technical Details

npm --version output:

node --version output:

pod --version output (iOS issues only):

Additional Context

@OskarLebuda
Copy link
Author

Duplicated #6308

@ionitron-bot
Copy link

ionitron-bot bot commented Mar 22, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant