gi-soup-2.4.14: Libsoup bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.CookieJar

Contents

Description

 

Synopsis

Exported types

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

readOnly

Signals

changed