I am using a WKWebView to present a login page to the user. After logging in, I would like to retrieve the users ID. Initially wanted to include this in the Response Header, but apparently this is not possbile: AFAIK sadly you cannot do this with WKWebView.
It most certainly does not work in webView:decidePolicyForNavigationAction:decisionHandler: because the navigationAction.request is read-only and a non-mutable NSURLRequest instance that you cannot change.
How To add HttpHeader in request globally for ios swift
As an alternative approach, I will attempt to add a hidden html field to the Response body:
<input type="hidden" name="userID" value="The retrieved userID">
How do I extract this value?