NSHTTPCookieStorage doesn't add a default path to the cookie when setting cookie via setCookieWithURL

Originator:vibrazy
Number:rdar://29924140 Date Originated:9/1/2017
Status:Open Resolved:
Product:OS + SDK Product Version:10.2
Classification:Bug Reproducible:Always
 
aniel Tavares09-Jan-2017 09:11 AM


Area:
CFNetwork Framework

Summary:
Previous version would automagically add a trailling path to the cookie's url when setting it via setCookieWithURL. 10.2 doesn't add that anymore therefore breaking our codebase.

Steps to Reproduce:
10.2:
Doesn't set the cookie:
NSHTTPCookieStorage.sharedHTTPCookieStorage().setCookieWithURL(NSURL(string: "http://marketing.asos.com"), name: "cookieName", value: "cookieValue")

Works as intended: (Adding a path to the end of the URL)
NSHTTPCookieStorage.sharedHTTPCookieStorage().setCookieWithURL(NSURL(string: "http://marketing.asos.com/"), name: "cookieName", value: "cookieValue")

Expected Results:
Work as previous version and assume a default root path to the cookie if one is not set

Actual Results:
Doesn't save cookie

Version:
10.2

Notes:


Configuration:
Any device using 10.2

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!