0

I would like to know if it's possible to set a cookie in a webview to pass a query parameter to a webview URL in the following way. My URL would be mydomain.com?isMobile=true And would like to set the parameter isMobile=true as a fixed cookie to include And force the parameter.

The reason I need to do It with cookies is because I was told it's the correct way to do It, asswell because forcing the parameter directly into the URL is making some functions in my webview to not work as It would on a browser.

I'd appreciate any feedback even without using cookies about how to work webview to make some realtime web functions update as It would on a browser.

This issue is driving me absolutely crazy, thank you very much un advance.

2
  • 1
    Maybe this package can help? Commented Jan 18, 2022 at 8:58
  • Thank you for your comment Peter but in the initialCookies of the same webview plugin resolved mostly the issue, seems it's a problem with the JS of the webpage. Commented Jan 20, 2022 at 9:40

1 Answer 1

1

In the end They're were problems related to a firewall on the webpage that made the cookies not work as intended in the end the solution was as simple as declarion the initialCookies as follows in the WebView Widget.

WebView(
 initialCookies: [
      WebViewCookie(
         name: cookieName,
         value: cookieVal,
         domain: cookieDomain,
         path: cookiePath,
     ),
   ],
),
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.