Search results for

ASWebAuthenticationSession cookie

1,295 results found

Post

Replies

Boosts

Views

Activity

How to synchronize cookies in WKWebview
Please tell me how to keep the cookie of WKWebbview.I'm changing Webview from UIWebView to WKWebview.I can not get session ID (cookie) regenerated by server login authentication and Then I can not log in.It looks like cookie synchronization does not go well.So please tell me how to keep the cookie of WK Webbview.I am programing by the link method belowhttps://qiita.com/yonell/items/bbd45c64a0068f7dc9c3iOS9Swift3Xcode:8.x< login authentication>1.Login authentication with WebAPI ⇒Get PHPSESSID from server2.Send PHPSESSID with MutableURLRequest ※I set PHPSESSID to WKWebview with WKUserScript3.Login authentication with server (using cakephp authComponent) ⇒Regenerate session ID and reset to cookie(PHPSESSID)★ ★problem  The cookie of the request is not updated at the timing of webView (decidePolicyFor: decisionHandler )
1
0
1.9k
Jan ’18
How to synchronize cookies in WKWebview
We have changed from UIWebView we used to WKWebview. Changing WebView from UIWebView to WKWebView prevents login. Regenerate the PHPSESSID on the server in the login processing of the Web application and reconfigure it as a cookie. Because ios side can not confirm the update, I think that there is a problem with cookie synchronization processing. How do I synchronize cookies in WK WebView? ◆Configuration 【ios】 ios version: iOS9 Xcode:8.3.3 Swift3 【Server】 WebServer:CentOS framework:cakePHP 2.9.9(Using authComponent) ◆Reference processing https://qiita.com/yonell/items/bbd45c64a0068f7dc9c3 ◆Steps to Reproduce 1.Login authentication with WebAPI ⇒PHPSESSID is returned from the server Set PHPSESSID to HTTPCookieStorage.shared.cookies 2.Generate WebView with WKWebview ⇒PHPSESSID returned from the server is set to WKWebView's configuretion using WKUserScript 3.application login processing  ⇒Loading PHPSESSID obtained from server with MutableURLRequest. ※At this time, the server regenerate
1
0
1.8k
Jan ’18
How to synchronize cookies in WKWebview
We have changed from UIWebView we used to WKWebview.Changing WebView from UIWebView to WKWebView prevents login.Regenerate the PHPSESSID on the server in the login processing of the Web application and reconfigure it as a cookie.Because ios side can not confirm the update, I think that there is a problem with cookie synchronization processing.How do I synchronize cookies in WK WebView?◆Configuration【ios】   ios version: iOS9 Xcode:8.3.3 Swift3【Server】 WebServer:CentOS framework:cakePHP 2.9.9(Using authComponent)◆Steps to Reproduce1.Login authentication with WebAPI ⇒PHPSESSID is returned from the server   Set PHPSESSID to HTTPCookieStorage.shared.cookies2.Generate WebView with WKWebview  ⇒PHPSESSID returned from the server is set to WKWebView's configuretion using WKUserScript3.application login processing  ⇒Loading PHPSESSID obtained from server with MutableURLRequest.   ※At this time, the server regenerates PHPSESSID and reconfigures it as a cookie4.Screen transition  ⇒It redirects to the lo
11
0
21k
Jan ’18
Reply to How to synchronize cookies in WKWebview
WKWebView runs all of its networking in a separate process and thus does not ‘see’ your process’s cookie store. In iOS 11 we added WKHTTPCookieStore to give you full access to the web view’s cookie store. I recommend that you start by getting that working then, if you need to support versions of iOS, we can talk about workarounds. Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Jan ’18
Reply to How to synchronize cookies in WKWebview
Thank you for your answer. I understood that WKWebview does not recognize the cookie store of the process. It is difficult to handle WKWebview (cookie store) on iOS 9. I am considering support for iOS 11, WKWebview and WKHTTP cookie store will work properly on iOS 10 or earlier devices? Please let me know if there is a problem with iOS version. Thank you
Jan ’18
Reply to How to synchronize cookies in WKWebview
Supported cookie sync with WKWebView on older platforms is tricky. There are two techniques that might work: You can set a cookie in the headers of the request you pass to -[WKWebView loadRequest:].You can get and set cookies from within the web view by running JavaScript code (using -evaluateJavaScript:completionHandler:) that accesses the JavaScript document.cookie value.However, these approaches might not working depending on the specifics of your cookies.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Jan ’18
Can't view "sales and trends"?
Hi, everytime i click sales and trends it never loads the page, it just takes me right back to the main itunes connect page. If i click sales and trends through the app page it gives me this error: an unexpected error occurred. try reloading the page. if the problem persists contact us. Does anyone know what the problem could be? I reloaded the page i've deleted cookies, history ect. Still no change. Thanks..
9
0
3.7k
Feb ’18
WKWebView changing cookie version to 1
When I take a cookie and add it to a WKWebView's httpCookieStore, the cookie's version suddenly changes from 0 to 1.Is this a bug, or is there some actual reason this should happen?It's easily reproducible in Playgrounds like this:import WebKit import PlaygroundSupport let cookie = HTTPCookie(properties: [.path: /, .name: foo, .value: bar, .domain: foobar.com, .version: 0])! let webView = WKWebView() print(My cookie is named (cookie.name) and its version is (cookie.version)) webView.configuration.websiteDataStore.httpCookieStore.setCookie(cookie) { webView.configuration.websiteDataStore.httpCookieStore.getAllCookies { cookies in let transferredCookie = cookies.first! print(Transferred cookie is named (transferredCookie.name) and its version is (transferredCookie.version)) } } PlaygroundPage.current.needsIndefiniteExecution = trueThe output is this:My cookie is named foo and its version is 0Transferred cookie is named foo and its
2
0
863
Feb ’18
Accessing cookie not possible on devices running > iOS 09
Dear experts,We have an hybrid application built with cordova for both iOS and Android platforms. The app was successfully running until the devices were upgraded(from iOS 9) to latest.We perform login to backend server using normal ajax call and in the response the Cookie is read and send in subsequent requests.We are using Set-Cookie to achieve SSO, though we can see Set-Cookie in repsonse headers via debug, When I try jqHR.getAllResponseHeaders() method all the values except 'Set-Cookie' can be seen in console.Code snippet to perform login and utilize cookie received in response is as below.jQuery.ajax({ headers : { X-Requested-With : XMLHttpRequest, Content-Type : application/json, DataServiceVersion : 2.0, X-CSRF-Token : Fetch, Authorization : Basic + Base64.encode(username+:+password), Access-Control-Allow-Credentials: include }, type : GET, url : util.Models.serviceURL, timeout : 60000, dataType : json, success : function(data,textStatus, jqXHR) { //Set Cookie
Topic: Safari & Web SubTopic: General Tags:
2
0
1.8k
Feb ’18
Setting cookies with WKHTTPCookieStorage do not sync with wkwebview
I created a method to set cookies from HTTPCookieStorage into WKHTTPCookieStorage, as it seems this api is full async so i created an async method that sets the cookies in wkHTTPCookieStorage.func copyCookiesToWKStore(completion: @escaping () -> Void) { if let httpCookies: [HTTPCookie] = self.httpCookieStorage.cookies { print(updating wkCookies with httpCookies: (httpCookies)) func copyCookiesAsync(index: Int, cookieHandler: SDCookiesHandler?) { if let cookieHandler = cookieHandler, index < httpCookies.count { let cookie = httpCookies[index] cookieHandler.wkCookieStore.setCookie(cookie, completionHandler: { print(set cookie in Cookie Storage: (cookie)) DispatchQueue.main.async { copyCookiesAsync(index: index + 1, cookieHandler: cookieHandler) } }) } else { completion() } } weak var cookieHandler = self copyCookiesAsync(index: 0, cookieHandler: cookieHandler) } else { completion() } }and the load the request in the wkwebview:wkCookiesHandler.
20
0
35k
Feb ’18