gi-soup-2.4.19: Libsoup bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.CookieJar

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

newtype CookieJar Source #

Memory-managed wrapper type.

Instances
GObject CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

Methods

gobjectType :: IO GType #

HasParentTypes CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

type ParentTypes CookieJar Source # 
Instance details

Defined in GI.Soup.Objects.CookieJar

type ParentTypes CookieJar = Object ': (SessionFeature ': ([] :: [Type]))

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
(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.

noCookieJar :: Maybe CookieJar Source #

A convenience alias for Nothing :: Maybe CookieJar.

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

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.

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

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 CookieJarAcceptPolicyNoThirdParty is set 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 => CookieJarAcceptPolicy -> IO (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 => Bool -> IO (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 C_CookieJarChangedCallback = Ptr () -> Ptr Cookie -> Ptr Cookie -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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 -> 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

onCookieJarChanged :: (IsCookieJar a, MonadIO m) => 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