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.

iOS - get returns empty object

See original GitHub issue

I have tried get() with specific examples with and without the useWebKit variable. Each time, CookieManager has returned as an empty object, and no errors have been created. Built on react native init. No expo.

For example:

import CookieManager from '@react-native-community/cookies';

...
const getCookies = async () => {
  const useWebKit = true;
  try {
    const cookies = await CookieManager.getAll(useWebKit);
    console.log({cookies});
  } catch (error) {
    console.log({error});
  }
};

returns {"cookies": {}} in the console

I am using iOS ver 13.5. In package.json: “@react-native-community/cookies”: “^2.0.9”, “react-native-wkwebview-reborn”: “^2.0.0”,

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
safaiyehcommented, Jul 25, 2020

@vlerant-saiti the best way would to store the cookie in storage and set the cookie before you make the request. Would this work for you?

0reactions
Willyfpcommented, Dec 2, 2022

I had the same problem this week, in my case, I was setting an expiration with Dayjs and this caused the problem. Using the vanilla Date API fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS Core Data executeFetchRequest is returning empty object
First, the reason that 'objects' had one row, but appeared "empty" was because that is the default behavior. Values will not be retrieved...
Read more >
CookieManager.get() returns empty object iOS #164 - GitHub
I use CookieManager.get() to get them. It works fine on Android but returns empty object on iOS. Is there any ideas why it...
Read more >
GET request from React to Flask sometimes returns empty object
GET request from React to Flask sometimes returns empty object. Hello! So, I sometimes get this in React from the fetch request: "[{…}] ......
Read more >
[Solved]-object return empty description in iOS - appsloveworld
The problem is with your if condition. fblink is nil , you are checking nil is equal to [NSNull null] so this case...
Read more >
LWC controller returns empty objects
guys! I have a problem. Every time, when I'm trying to execute quick action i see this error-message: [e.opportunity is undefined]. Can somebody ......
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