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: [Android] [Http / Cookies] Cookies set by server cannot be deleted by the client #6197

Open
silviogutierrez opened this issue Dec 28, 2022 · 0 comments

Comments

@silviogutierrez
Copy link

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊

Latest Dependencies:

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

Installed Dependencies:

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

[success] iOS looking great! 👌
[success] Android looking great! 👌


Platform(s)

Android

Current Behavior

Set a cookie on the server, using Set-Cookie header. Try deleting it on the client by manipulating document.cookie. It won't take effect and the Cookie header will still be sent.

Sample code to delete a cookie:

document.cookie = `${cookieName}=;expires=Thu, 01 Jan 1970 00:00:01 GMT;`;

Expected Behavior

Unless forbidden/invisible due to HttpOnly, you should be able to unset a cookie on the client.

Code Reproduction

https://github.com/silviogutierrez/capacitor-http-tester (#6177)

  1. Clone the repository.
  2. Run npm install and npm cap sync to get both platforms working.
  3. Run npm run build && node server.js to start the local server.
  4. Open http://localhost:3000 and see how everything works on the browser.
  5. Run npx cap open ios and run the simulator, observe passing/failing tests.
  6. Run npx cap open android and run the emulator, observe passing/failing test with this issue number.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants