Skip to content
This repository was archived by the owner on Jan 24, 2020. It is now read-only.
This repository was archived by the owner on Jan 24, 2020. It is now read-only.

Crash when loading session cookie #120

@lukecyca

Description

@lukecyca

Platform: iOS

Version: master (f113747)

Steps to reproduce:

  1. Use fetch() to hit an endpoint that sets a cookie with no expiry (ie: a session cookie). For example set-cookie: foo=bar; Path=/; HttpOnly
  2. Call CookieManager.get("https://example.com");

The result is the following stacktrace:

Exception '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: expiresDate)' was thrown while invoking get on target RNCookieManagerIOS with params (
    "https://app.example.com",
    0,
    24,
    25
)
callstack: (
	0   CoreFoundation                      0x00000001123e929b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000110641735 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001123338fc _CFThrowFormattedException + 194
	3   CoreFoundation                      0x000000011245b3f6 -[__NSDictionaryM setObject:forKey:] + 1046
	4   CM_App                              0x000000010f9c8380 -[RNCookieManagerIOS get:useWebKit:resolver:rejecter:] + 1584
	5   CoreFoundation                      0x00000001123f011c __invoking___ + 140
	6   CoreFoundation                      0x00000001123ed5b5 -[NSInvocation invoke] + 325
	7   CoreFoundation                      0x00000001123eda06 -[NSInvocation invokeWithTarget:] + 54
	8   CM_App                              0x000000010f78a25a -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2810
	9   CM_App                              0x000000010f845f96 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 790
	10  CM_App                              0x000000010f845aaf _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 127
	11  CM_App                              0x000000010f845a29 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25
	12  libdispatch.dylib                   0x000000011526e51d _dispatch_call_block_and_release + 12
	13  libdispatch.dylib                   0x000000011526f587 _dispatch_client_callout + 8
	14  libdispatch.dylib                   0x0000000115276058 _dispatch_lane_serial_drain + 720
	15  libdispatch.dylib                   0x0000000115276b9b _dispatch_lane_invoke + 401
	16  libdispatch.dylib                   0x000000011527f9c6 _dispatch_workloop_worker_thread + 645
	17  libsystem_pthread.dylib             0x000000011564ffd2 _pthread_wqthread + 980
	18  libsystem_pthread.dylib             0x000000011564fbe9 start_wqthread + 13
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions