内容表

上一话题

PySide2.QtWebEngineCore

下一话题

QWebEngineHttpRequest

QWebEngineCookieStore

QWebEngineCookieStore class provides access to Chromium’s cookies. 更多

Inheritance diagram of PySide2.QtWebEngineCore.QWebEngineCookieStore

概要

函数

信号

详细描述

The class allows to access HTTP cookies of Chromium for a specific profile. It can be used to synchronize cookies of Chromium and the QNetworkAccessManager , as well as to set, delete, and intercept cookies during navigation. Because cookie operations are asynchronous, the user can choose to provide a callback function to get notified about the success of the operation. The signal handlers for removal and addition should not be used to execute heavy tasks, because they might block the IO thread in case of a blocking connection.

使用 cookieStore() and cookieStore() to access the cookie store object for a specific profile.

PySide2.QtWebEngineCore.QWebEngineCookieStore. cookieAdded ( cookie )
参数

cookie QNetworkCookie

PySide2.QtWebEngineCore.QWebEngineCookieStore. cookieRemoved ( cookie )
参数

cookie QNetworkCookie

PySide2.QtWebEngineCore.QWebEngineCookieStore. deleteAllCookies ( )

Deletes all the cookies in the cookie store.

注意

This operation is asynchronous.

另请参阅

loadAllCookies()

PySide2.QtWebEngineCore.QWebEngineCookieStore. deleteCookie ( cookie [ , origin=QUrl() ] )
参数
  • cookie QNetworkCookie

  • origin QUrl

Deletes cookie from the cookie store. It is possible to provide an optional origin URL argument to limit the scope of the cookie to be deleted.

注意

This operation is asynchronous.

PySide2.QtWebEngineCore.QWebEngineCookieStore. deleteSessionCookies ( )

Deletes all the session cookies in the cookie store. Session cookies do not have an expiration date assigned to them.

注意

This operation is asynchronous.

另请参阅

loadAllCookies()

PySide2.QtWebEngineCore.QWebEngineCookieStore. loadAllCookies ( )

Loads all the cookies into the cookie store. The cookieAdded() signal is emitted on every loaded cookie. Cookies are loaded automatically when the store gets initialized, which in most cases happens on loading the first URL. However, calling this function is useful if cookies should be listed before entering the web content.

注意

This operation is asynchronous.

PySide2.QtWebEngineCore.QWebEngineCookieStore. setCookie ( cookie [ , origin=QUrl() ] )
参数
  • cookie QNetworkCookie

  • origin QUrl

添加 cookie to the cookie store.

注意

cookie specifies a domain() that does not start with a dot, a dot is automatically prepended. To limit the cookie to the exact server, omit domain() and set origin 代替。

The provided URL should also include the scheme.

注意

This operation is asynchronous.