Skip to content

Commit 354e9bb

Browse files
authored
fix(iOS): fix 'secure' and 'httpOnly' values always being false (#126)
1 parent 0b99c33 commit 354e9bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ios/RNCookieManagerIOS/RNCookieManagerIOS.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ -(NSHTTPCookie *)makeHTTPCookieObject:(NSURL *)url
313313
if (!isEmpty(expires)) {
314314
[cookieProperties setObject:expires forKey:NSHTTPCookieExpires];
315315
}
316-
if (!isEmpty(secure)) {
317-
[cookieProperties setObject:secure forKey:@"secure"];
316+
if ([secure boolValue]) {
317+
[cookieProperties setObject:secure forKey:NSHTTPCookieSecure];
318318
}
319-
if (!isEmpty(httpOnly)) {
320-
[cookieProperties setObject:httpOnly forKey:@"HTTPOnly"];
319+
if ([httpOnly boolValue]) {
320+
[cookieProperties setObject:httpOnly forKey:@"HttpOnly"];
321321
}
322322

323323
NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:cookieProperties];

0 commit comments

Comments
 (0)