gi-soup-2.4.26: Libsoup bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Soup.Objects.CookieJar

Description

No description available in the introspection data.

Synopsis

Exported types

newtype CookieJar Source #

Memory-managed wrapper type.

Constructors

CookieJar (ManagedPtr CookieJar) 

Instances

Instances details
Eq CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

GObject CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

ManagedPtrNewtype CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

Methods

toManagedPtr :: CookieJar -> ManagedPtr CookieJar

TypedObject CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

Methods

glibType :: IO GType

HasParentTypes CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

IsGValue (Maybe CookieJar) Source #

Convert CookieJar to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Soup.Objects.CookieJar

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe CookieJar -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe CookieJar)

type ParentTypes CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

type ParentTypes CookieJar = '[Object, SessionFeature]

class (GObject o, IsDescendantOf CookieJar o) => IsCookieJar o Source #

Type class for types which can be safely cast to CookieJar, for instance with toCookieJar.

Instances

Instances details
(GObject o, IsDescendantOf CookieJar o) => IsCookieJar o Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

toCookieJar :: (MonadIO m, IsCookieJar o) => o -> m CookieJar Source #

Cast to CookieJar, for types for which this is known to be safe. For general casts, use castTo.

Methods

addCookie

cookieJarAddCookie Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> Cookie

cookie: a Cookie

-> m () 

Adds cookie to jar, emitting the 'changed' signal if we are modifying an existing cookie or adding a valid new cookie ('valid' means that the cookie's expire date is not in the past).

cookie will be 'stolen' by the jar, so don't free it afterwards.

Since: 2.26

addCookieFull

cookieJarAddCookieFull Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> Cookie

cookie: a Cookie

-> Maybe URI

uri: the URI setting the cookie

-> Maybe URI

firstParty: the URI for the main document

-> m () 

Adds cookie to jar, emitting the 'changed' signal if we are modifying an existing cookie or adding a valid new cookie ('valid' means that the cookie's expire date is not in the past).

firstParty will be used to reject cookies coming from third party resources in case such a security policy is set in the jar.

uri will be used to reject setting or overwriting secure cookies from insecure origins. Nothing is treated as secure.

cookie will be 'stolen' by the jar, so don't free it afterwards.

Since: 2.68

addCookieWithFirstParty

cookieJarAddCookieWithFirstParty Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> URI

firstParty: the URI for the main document

-> Cookie

cookie: a Cookie

-> m () 

Adds cookie to jar, emitting the 'changed' signal if we are modifying an existing cookie or adding a valid new cookie ('valid' means that the cookie's expire date is not in the past).

firstParty will be used to reject cookies coming from third party resources in case such a security policy is set in the jar.

cookie will be 'stolen' by the jar, so don't free it afterwards.

For secure cookies to work properly you may want to use cookieJarAddCookieFull.

Since: 2.40

allCookies

cookieJarAllCookies Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> m [Cookie]

Returns: a SList with all the cookies in the jar.

Constructs a SList with every cookie inside the jar. The cookies in the list are a copy of the original, so you have to free them when you are done with them.

Since: 2.26

deleteCookie

cookieJarDeleteCookie Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> Cookie

cookie: a Cookie

-> m () 

Deletes cookie from jar, emitting the 'changed' signal.

Since: 2.26

getAcceptPolicy

cookieJarGetAcceptPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> m CookieJarAcceptPolicy

Returns: the CookieJarAcceptPolicy set in the jar

Gets jar's CookieJarAcceptPolicy

Since: 2.30

getCookieList

cookieJarGetCookieList Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> URI

uri: a URI

-> Bool

forHttp: whether or not the return value is being passed directly to an HTTP operation

-> m [Cookie]

Returns: a SList with the cookies in the jar that would be sent with a request to uri.

Retrieves the list of cookies that would be sent with a request to uri as a SList of Cookie objects.

If forHttp is True, the return value will include cookies marked "HttpOnly" (that is, cookies that the server wishes to keep hidden from client-side scripting operations such as the JavaScript document.cookies property). Since CookieJar sets the Cookie header itself when making the actual HTTP request, you should almost certainly be setting forHttp to False if you are calling this.

Since: 2.40

getCookieListWithSameSiteInfo

cookieJarGetCookieListWithSameSiteInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> URI

uri: a URI

-> Maybe URI

topLevel: a URI for the top level document

-> Maybe URI

siteForCookies: a URI indicating the origin to get cookies for

-> Bool

forHttp: whether or not the return value is being passed directly to an HTTP operation

-> Bool

isSafeMethod: if the HTTP method is safe, as defined by RFC 7231, ignored when forHttp is False

-> Bool

isTopLevelNavigation: whether or not the HTTP request is part of top level navigation

-> m [Cookie]

Returns: a SList with the cookies in the jar that would be sent with a request to uri.

This is an extended version of cookieJarGetCookieList that provides more information required to use SameSite cookies. See the SameSite cookies spec for more detailed information.

Since: 2.70

getCookies

cookieJarGetCookies Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> URI

uri: a URI

-> Bool

forHttp: whether or not the return value is being passed directly to an HTTP operation

-> m (Maybe Text)

Returns: the cookies, in string form, or Nothing if there are no cookies for uri.

Retrieves (in Cookie-header form) the list of cookies that would be sent with a request to uri.

If forHttp is True, the return value will include cookies marked "HttpOnly" (that is, cookies that the server wishes to keep hidden from client-side scripting operations such as the JavaScript document.cookies property). Since CookieJar sets the Cookie header itself when making the actual HTTP request, you should almost certainly be setting forHttp to False if you are calling this.

Since: 2.24

isPersistent

cookieJarIsPersistent Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> m Bool

Returns: True if jar storage is persistent or False otherwise.

Gets whether jar stores cookies persistenly.

Since: 2.40

new

cookieJarNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m CookieJar

Returns: a new CookieJar

Creates a new CookieJar. The base CookieJar class does not support persistent storage of cookies; use a subclass for that.

Since: 2.24

save

cookieJarSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> m () 

Deprecated: This is a no-op.

This function exists for backward compatibility, but does not do anything any more; cookie jars are saved automatically when they are changed.

Since: 2.24

setAcceptPolicy

cookieJarSetAcceptPolicy Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> CookieJarAcceptPolicy

policy: a CookieJarAcceptPolicy

-> m () 

Sets policy as the cookie acceptance policy for jar.

Since: 2.30

setCookie

cookieJarSetCookie Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> URI

uri: the URI setting the cookie

-> Text

cookie: the stringified cookie to set

-> m () 

Adds cookie to jar, exactly as though it had appeared in a Set-Cookie header returned from a request to uri.

Keep in mind that if the CookieJarAcceptPolicy set is either CookieJarAcceptPolicyNoThirdParty or CookieJarAcceptPolicyGrandfatheredThirdParty you'll need to use cookieJarSetCookieWithFirstParty, otherwise the jar will have no way of knowing if the cookie is being set by a third party or not.

Since: 2.24

setCookieWithFirstParty

cookieJarSetCookieWithFirstParty Source #

Arguments

:: (HasCallStack, MonadIO m, IsCookieJar a) 
=> a

jar: a CookieJar

-> URI

uri: the URI setting the cookie

-> URI

firstParty: the URI for the main document

-> Text

cookie: the stringified cookie to set

-> m () 

Adds cookie to jar, exactly as though it had appeared in a Set-Cookie header returned from a request to uri. firstParty will be used to reject cookies coming from third party resources in case such a security policy is set in the jar.

Since: 2.30

Properties

acceptPolicy

The policy the jar should follow to accept or reject cookies

Since: 2.30

constructCookieJarAcceptPolicy :: (IsCookieJar o, MonadIO m) => CookieJarAcceptPolicy -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “accept-policy” property. This is rarely needed directly, but it is used by new.

getCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> m CookieJarAcceptPolicy Source #

Get the value of the “accept-policy” property. When overloading is enabled, this is equivalent to

get cookieJar #acceptPolicy

setCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> CookieJarAcceptPolicy -> m () Source #

Set the value of the “accept-policy” property. When overloading is enabled, this is equivalent to

set cookieJar [ #acceptPolicy := value ]

readOnly

No description available in the introspection data.

constructCookieJarReadOnly :: (IsCookieJar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “read-only” property. This is rarely needed directly, but it is used by new.

getCookieJarReadOnly :: (MonadIO m, IsCookieJar o) => o -> m Bool Source #

Get the value of the “read-only” property. When overloading is enabled, this is equivalent to

get cookieJar #readOnly

Signals

changed

type CookieJarChangedCallback Source #

Arguments

 = Cookie

oldCookie: the old Cookie value

-> Cookie

newCookie: the new Cookie value

-> IO () 

Emitted when jar changes. If a cookie has been added, newCookie will contain the newly-added cookie and oldCookie will be Nothing. If a cookie has been deleted, oldCookie will contain the to-be-deleted cookie and newCookie will be Nothing. If a cookie has been changed, oldCookie will contain its old value, and newCookie its new value.

afterCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> ((?self :: a) => CookieJarChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the changed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after cookieJar #changed callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> ((?self :: a) => CookieJarChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the changed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on cookieJar #changed callback