react-native-cookies
react-native-cookies copied to clipboard
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
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
+[RCTConvert NSDictionary:] RCTConvert.m:55 __41-[RCTModuleMethod processMethodSignature]_block_invoke.135 -[RCTModuleMethod invokeWithBridge:module:arguments:] facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) _dispatch_call_block_and_release _dispatch_client_callout _dispatch_lane_serial_drain _dispatch_lane_invoke _dispatch_workloop_worker_thread _pthread_wqthread start_wqthread
I followed your example and got this error
CookieManager.setFromResponse(
'http://localhost',
'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly')
.then((res) => {
alert(res)
// res
will be true or false depending on success.
console.log('CookieManager.setFromResponse =>', res);
});
I ran into the same issue so I use set-cookie-parser, and this works pretty well https://github.com/nfriedly/set-cookie-parser
I ran into the same issue so I use set-cookie-parser, and this works pretty well https://github.com/nfriedly/set-cookie-parser
const combinedCookieHeader = res.headers.get('Set-Cookie'); // undefined
What should I do if I can't get a cookie?
https://github.com/joeferraro/react-native-cookies/issues/15
@UZIhuhuhu Did u find out how todo this?
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.