@@ -79,6 +79,7 @@ @implementation SocketIO
79
79
@synthesize isConnected = _isConnected,
80
80
isConnecting = _isConnecting,
81
81
useSecure = _useSecure,
82
+ cookies = _cookies,
82
83
delegate = _delegate,
83
84
heartbeatTimeout = _heartbeatTimeout,
84
85
returnAllDataFromAck = _returnAllDataFromAck;
@@ -106,11 +107,6 @@ - (void) connectToHost:(NSString *)host onPort:(NSInteger)port withParams:(NSDic
106
107
[self connectToHost: host onPort: port withParams: params withNamespace: @" " withConnectionTimeout: defaultConnectionTimeout];
107
108
}
108
109
109
- - (void ) connectToHost : (NSString *)host onPort : (NSInteger )port withParams : (NSDictionary *)params withCookieParams : (NSDictionary *)cookieParams
110
- {
111
- [self connectToHost: host onPort: port withParams: params withCookieParams: cookieParams withNamespace: @" " withConnectionTimeout: defaultConnectionTimeout];
112
- }
113
-
114
110
- (void ) connectToHost : (NSString *)host
115
111
onPort : (NSInteger )port
116
112
withParams : (NSDictionary *)params
@@ -122,25 +118,6 @@ - (void) connectToHost:(NSString *)host
122
118
- (void ) connectToHost : (NSString *)host
123
119
onPort : (NSInteger )port
124
120
withParams : (NSDictionary *)params
125
- withCookieParams : (NSDictionary *)cookieParams
126
- withNamespace : (NSString *)endpoint
127
- {
128
- [self connectToHost: host onPort: port withParams: params withCookieParams: cookieParams withNamespace: endpoint withConnectionTimeout: defaultConnectionTimeout];
129
- }
130
-
131
- - (void ) connectToHost : (NSString *)host
132
- onPort : (NSInteger )port
133
- withParams : (NSDictionary *)params
134
- withNamespace : (NSString *)endpoint
135
- withConnectionTimeout : (NSTimeInterval )connectionTimeout
136
- {
137
- [self connectToHost: host onPort: port withParams: params withCookieParams: nil withNamespace: endpoint withConnectionTimeout: defaultConnectionTimeout];
138
- }
139
-
140
- - (void ) connectToHost : (NSString *)host
141
- onPort : (NSInteger )port
142
- withParams : (NSDictionary *)params
143
- withCookieParams : (NSDictionary *)cookieParams
144
121
withNamespace : (NSString *)endpoint
145
122
withConnectionTimeout : (NSTimeInterval )connectionTimeout
146
123
{
@@ -172,10 +149,9 @@ - (void) connectToHost:(NSString *)host
172
149
cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData
173
150
timeoutInterval: connectionTimeout];
174
151
175
- if (cookieParams) {
176
- NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties: cookieParams];
177
- NSArray * cookieArray = [NSArray arrayWithObjects: cookie, nil ];
178
- NSDictionary * headers = [NSHTTPCookie requestHeaderFieldsWithCookies: cookieArray];
152
+ if (_cookies != nil ) {
153
+ DEBUGLOG (@" Adding cookie(s): %@ " , [_cookies description ]);
154
+ NSDictionary *headers = [NSHTTPCookie requestHeaderFieldsWithCookies: _cookies];
179
155
[request setAllHTTPHeaderFields: headers];
180
156
}
181
157
0 commit comments