question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Capacitor 4.3 Http/Cookies: document.cookie is not accessible (deletion)

See original GitHub issue

First of all, thank you for putting so much effort into Capacitor. With CapacitorCookies and CapacitorHttp it is now easily possible to run an app connected to an API locally.

Capacitor Doctor   

Latest Dependencies:

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

Installed Dependencies:

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

Platform(s)

iOS, Android

Description

Capacitor Http/Cookies should provide the possibilty to handle document.cookie. This is necessary for many libraries, for example to delete cookies. A logout is also not possible from the app, when using cookies for authentication.

document.cookie = "auth=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ItsChaceDcommented, Sep 23, 2022

@malte94 Yes, this should handle 3rd party libraries modifying cookies since every document.cookie call will get proxied through the native layer if it is enabled in the config. As far as Cookie based authentication (3rd Party Cookies), Capacitor should also intercept any Set-Cookie response headers and handle them accordingly on the native platforms 😄 If you encounter an issue though, please create a reproduction and I can investigate it.

1reaction
ItsChaceDcommented, Sep 22, 2022

Hello, Capacitor 4.3 should handle document.cookie for you, as long as you enable it in the configuration. See: https://capacitorjs.com/docs/apis/cookies#example-configuration

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capacitor Cookies Plugin API
The Capacitor Cookies API provides native cookie support via patching `document.cookie` to use native libraries.
Read more >
Cookies on localhost with explicit domain - Stack Overflow
When working on localhost , the cookie domain must be omitted entirely. You should not set it to "" or NULL or FALSE...
Read more >
SameSite cookies explained - web.dev
Learn how to mark your cookies for first-party and third-party usage with the SameSite attribute. You can enhance your site's security by ...
Read more >
[Solved]-Xcode8 Controllers are Grey which are designed in Xcode ...
How can I fix "Freeform Size simulated metrics are not available prior to Xcode 4.2" warnings? ... xcode error Unable to find a...
Read more >
Asynchronous Access to HTTP Cookies - Chrome Developers
The Cookie Store API exposes HTTP cookies to service workers and offers an asynchronous alternative to document.cookie . The API makes it easier ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found