WebCookieJar

Since: BlackBerry 10.0.0

#include <bb/cascades/WebCookieJar>

The cookie database for the WebView control.

The WebView uses network protocols such as HTTP, which store "cookies" to maintain some persistent information across requests.

The same cookie database is shared among all WebView controls running in the same process, so the changes made using methods in this class will affect all WebViews.

This class uses strings to represent cookies. The strings are formatted according to the RFC 6265 specification, found at http://tools.ietf.org/html/rfc6265.

Use WebStorage::cookieJar() to obtain an instance of this class. Use WebSettings::setCookiesEnabled(bool) to enable or disable cookies. Use WebStorage::clearCookies() to clear the cookie database.


Overview

Public Functions Index

Q_INVOKABLE QStringListcookiesForUrl (const QUrl &url) const
Q_INVOKABLE voidsetCookiesFromUrl (const QUrl &url, const QStringList &cookies)

Public Functions

Q_INVOKABLE QStringList cookiesForUrl (

Retrieves all cookies whose domain and path match the provided URL.

Parameters
url

Cookies with domain and path that match this URL will be fetched.

Return:

A list of strings, each string representing a cookie.

Since:

BlackBerry 10.0.0

Q_INVOKABLE void setCookiesFromUrl (

Adds the cookies provided in the list to the cookie database.

If a cookie with the same name and domain+path as one of the cookies provided already exists, it will be replaced.

If no domain and/or path is provided in a cookie, the domain and/or path will be inferred from the provided URL.

Each cookie is defined by a string that must follow the RFC 6265 specification.

Parameters
url

Will be used to infer domain and path if not specified in a cookie.

cookies

A list of cookies to add or replace.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus