Share REST API session cookies with SFAuthenticationSession or SFSafariViewController

256 Views Asked by At

Actually, I'm calling REST API services using NSURLSession and I get the session cookies which provided headers. Now I want to share the same cookies with SFAuthenticationSession or SFSafariViewController and load the web page without login.

My Question: Share API cookies and load the web page without login.

Please refer below code to get the cookies from NSURLSession:

 NSArray * all = [NSHTTPCookie cookiesWithResponseHeaderFields:[reponse allHeaderFields] forURL:url];
 [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:all forURL:url mainDocumentURL:nil];
0

There are 0 best solutions below