### Constructor

# WPEWebKit NetworkSession new

since: 2.40

#### Declaration [src]

    WebKitNetworkSession*
    webkit_network_session_new (
      const char* data_directory,
      const char* cache_directory
    )

#### Description [src]

Creates a new `WebKitNetworkSession` with a persistent `WebKitWebsiteDataManager`. The parameters `data_directory` and `cache_directory` will be used as construct properties of the `WebKitWebsiteDataManager` of the network session. Note that if `NULL` is passed, the default directory will be passed to `WebKitWebsiteDataManager` so that `webkit_website_data_manager_get_base_data_directory()` and `webkit_website_data_manager_get_base_cache_directory()` always return a value for non ephemeral sessions.

It must be passed as construct parameter of a `WebKitWebView`.

Available since: 2.40

#### Parameters

`data_directory`

  Type: `const char*`

  A base directory for data, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`cache_directory`

  Type: `const char*`

  A base directory for caches, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `WebKitNetworkSession`

The newly created `WebKitNetworkSession`.

The caller of the function takes ownership of the data, and is responsible for freeing it.