Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- newtype CookieJar = CookieJar (ManagedPtr CookieJar)
- class GObject o => IsCookieJar o
- toCookieJar :: (MonadIO m, IsCookieJar o) => o -> m CookieJar
- noCookieJar :: Maybe CookieJar
- cookieJarAddCookie :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> Cookie -> m ()
- cookieJarAddCookieWithFirstParty :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> URI -> Cookie -> m ()
- cookieJarAllCookies :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> m [Cookie]
- cookieJarDeleteCookie :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> Cookie -> m ()
- cookieJarGetAcceptPolicy :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> m CookieJarAcceptPolicy
- cookieJarGetCookieList :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> URI -> Bool -> m [Cookie]
- cookieJarGetCookies :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> URI -> Bool -> m (Maybe Text)
- cookieJarIsPersistent :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> m Bool
- cookieJarNew :: (HasCallStack, MonadIO m) => m CookieJar
- cookieJarSave :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> m ()
- cookieJarSetAcceptPolicy :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> CookieJarAcceptPolicy -> m ()
- cookieJarSetCookie :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> URI -> Text -> m ()
- cookieJarSetCookieWithFirstParty :: (HasCallStack, MonadIO m, IsCookieJar a) => a -> URI -> URI -> Text -> m ()
- constructCookieJarAcceptPolicy :: IsCookieJar o => CookieJarAcceptPolicy -> IO (GValueConstruct o)
- getCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> m CookieJarAcceptPolicy
- setCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> CookieJarAcceptPolicy -> m ()
- constructCookieJarReadOnly :: IsCookieJar o => Bool -> IO (GValueConstruct o)
- getCookieJarReadOnly :: (MonadIO m, IsCookieJar o) => o -> m Bool
- type C_CookieJarChangedCallback = Ptr () -> Ptr Cookie -> Ptr Cookie -> Ptr () -> IO ()
- type CookieJarChangedCallback = Cookie -> Cookie -> IO ()
- afterCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> CookieJarChangedCallback -> m SignalHandlerId
- genClosure_CookieJarChanged :: CookieJarChangedCallback -> IO Closure
- mk_CookieJarChangedCallback :: C_CookieJarChangedCallback -> IO (FunPtr C_CookieJarChangedCallback)
- noCookieJarChangedCallback :: Maybe CookieJarChangedCallback
- onCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> CookieJarChangedCallback -> m SignalHandlerId
- wrap_CookieJarChangedCallback :: CookieJarChangedCallback -> Ptr () -> Ptr Cookie -> Ptr Cookie -> Ptr () -> IO ()
Exported types
class GObject o => IsCookieJar o Source #
toCookieJar :: (MonadIO m, IsCookieJar o) => o -> m CookieJar Source #
Methods
addCookie
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> 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 #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> URI |
|
-> 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
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> m [Cookie] | Returns: a |
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 #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> Cookie |
|
-> m () |
Deletes cookie
from jar
, emitting the 'changed' signal.
Since: 2.26
getAcceptPolicy
cookieJarGetAcceptPolicy Source #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> m CookieJarAcceptPolicy | Returns: the |
Gets jar
's CookieJarAcceptPolicy
Since: 2.30
getCookieList
cookieJarGetCookieList Source #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> URI |
|
-> Bool |
|
-> m [Cookie] | Returns: a |
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
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> URI |
|
-> Bool |
|
-> m (Maybe Text) | Returns: the cookies, in string form, or |
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 #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether jar
stores cookies persistenly.
Since: 2.40
new
:: (HasCallStack, MonadIO m) | |
=> m CookieJar | Returns: a new |
save
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> CookieJarAcceptPolicy |
|
-> m () |
Sets policy
as the cookie acceptance policy for jar
.
Since: 2.30
setCookie
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> URI |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsCookieJar a) | |
=> a |
|
-> URI |
|
-> URI |
|
-> Text |
|
-> 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
constructCookieJarAcceptPolicy :: IsCookieJar o => CookieJarAcceptPolicy -> IO (GValueConstruct o) Source #
getCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> m CookieJarAcceptPolicy Source #
setCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> CookieJarAcceptPolicy -> m () Source #
readOnly
constructCookieJarReadOnly :: IsCookieJar o => Bool -> IO (GValueConstruct o) Source #
getCookieJarReadOnly :: (MonadIO m, IsCookieJar o) => o -> m Bool Source #
Signals
changed
afterCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> CookieJarChangedCallback -> m SignalHandlerId Source #
mk_CookieJarChangedCallback :: C_CookieJarChangedCallback -> IO (FunPtr C_CookieJarChangedCallback) Source #
onCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> CookieJarChangedCallback -> m SignalHandlerId Source #