react-native-cookies
                                
                                
                                
                                    react-native-cookies copied to clipboard
                            
                            
                            
                        Example from docs produces error
Copied this example into my project:
CookieManager.setFromResponse(
            'http://example.com',
            'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly')
and it produces this error:
JSON value 'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly' of type NSString cannot be converted to NSDictionary
Versions:
"react-native": "0.52.3",
"react-native-cookies": "^3.3.0",
ios 11.4
I'm avoiding filing multiple issues because it might all be one dumb setup thing on my part, but I'm having trouble setting cookies at all:
    CookieManager.set({
      name: 'myCookie',
      value: 'myValue',
      domain: 'http://localhost.com',
      origin: 'http://localhost.com',
      path: '/',
      version: '1',
      expiration: '2030-05-30T12:30:00.00-05:00'
    })
      .then( () => CookieManager.get('http://localhost.com') )
      .then(x => console.log(x)); // this line logs an empty object to the console
I don't understand why CookieManager.get('http://localhost.com') is returning an empty object there.
Copied this example into my project:
CookieManager.setFromResponse( 'http://example.com', 'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly')and it produces this error:
JSON value 'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly' of type NSString cannot be converted to NSDictionaryVersions:
"react-native": "0.52.3", "react-native-cookies": "^3.3.0",ios 11.4
https://github.com/joeferraro/react-native-cookies/issues/15
Any update on this? Im having the same issue
I have forked the repo here: https://github.com/safaiyeh/react-native-cookie-store We can create issues and PRs there to continue the development of the project.