Repository: flutter
Issue: [webview_flutter] Flutter 3 iOS WebView initialCookies are not being set 
Labels: platform-ios,p: webview,package,has reproducible steps,P2,found in release: 3.3,found in release: 3.6,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->
When setting `initialCookies` on a `WebView` with Flutter 3 on an iOS device the cookie(s) are not being applied. It seems to only affect iOS. Android is still working as expected.

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Run the Code Sample below with an iOS device<!-- (see "Code sample" section below) -->
2. Click on the button to open a WebView that is setting a test cookie
3. Observe that the cookie is not being applied on an iOS device

**Expected results:** The test_cookie should be set on both iOS and Android. Currently it is only being set on Android with the `initialCookies:` param on `WebView`.

**Actual results:** The test_cookie on iOS is not being set.

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [ElevatedButton(onPressed: () => Navigator.push(
          context,
          MaterialPageRoute(
            builder: (context) => WebViewTestPage(),
          ),
        ), child: const Text('Push to open webview'))],
        ),
      ),
    );
  }
}

class WebViewTestPage extends StatelessWidget {
  late WebViewController _controller;

  @override
  Widget build(BuildContext context) {
    return  WebView(
                onPageFinished: (_) async {
                  final cookie = await _controller.runJavascriptReturningResult('document.cookie');
                  _printCookie('Cookie: $cookie');
                },
                onWebViewCreated: ((controller) {
                  _controller = controller;
                }),
                initialUrl: 'https://www.google.com',
                javascriptMode: JavascriptMode.unrestricted,
                debuggingEnabled: true,
                initialCookies: [WebViewCookie(domain: 'www.google.com', name: 'test_cookie', value: 'fjklafjdl')],
              );
  }

  void _printCookie(String response) {
    print(response);
  }
}
```

</details>

<details>
  <summary>Console Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

```
iOS:  flutter: Cookie: 1P_JAR=2022-11-16-16; OGPC=19029186-12:
Droid: I/flutter (21392): Cookie: "test_cookie=fjklafjdl; 1P_JAR=2022-11-16-16"
```
</details>
<!-- Finally, paste the output of running `flutter doctor -v` here. -->
<details>
  <summary>Flutter Doctor</summary>

```
[✓] Flutter (Channel unknown, 3.3.8, on macOS 11.7 20G817 darwin-x64, locale en-US)
    • Flutter version 3.3.8 on channel unknown at /Users/user/Development/flutter
    • Framework revision 52b3dc25f6 (8 days ago), 2022-11-09 12:09:26 +0800
    • Engine revision 857bd6b74c
    • Dart version 2.18.4
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.71.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.52.0

[✓] Connected device (5 available)
    • Android SDK built for x86 (mobile) • emulator-5554                        • android-x86    • Android 10 (API 29) (emulator)
    • iPhone 12 (mobile)                 • 92663F14-DD56-4005-8577-54DD81C5F9AD • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)

[✓] HTTP Host Availability
    • All required HTTP hosts are available
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->