| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Soup.Objects.CookieJar
Contents
Description
No description available in the introspection data.
Synopsis
- newtype CookieJar = CookieJar (ManagedPtr CookieJar)
- class (GObject o, IsDescendantOf CookieJar 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 :: MonadIO m => CookieJarChangedCallback -> m (GClosure C_CookieJarChangedCallback)
- mk_CookieJarChangedCallback :: C_CookieJarChangedCallback -> IO (FunPtr C_CookieJarChangedCallback)
- noCookieJarChangedCallback :: Maybe CookieJarChangedCallback
- onCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> CookieJarChangedCallback -> m SignalHandlerId
- wrap_CookieJarChangedCallback :: CookieJarChangedCallback -> C_CookieJarChangedCallback
Exported types
Memory-managed wrapper type.
Constructors
| CookieJar (ManagedPtr CookieJar) |
Instances
| GObject CookieJar Source # | |
Defined in GI.Soup.Objects.CookieJar Methods gobjectType :: IO GType # | |
| HasParentTypes CookieJar Source # | |
Defined in GI.Soup.Objects.CookieJar | |
| type ParentTypes CookieJar Source # | |
Defined in GI.Soup.Objects.CookieJar | |
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 # | |
Defined in GI.Soup.Objects.CookieJar | |
toCookieJar :: (MonadIO m, IsCookieJar o) => o -> m CookieJar Source #
Methods
addCookie
Arguments
| :: (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 #
Arguments
| :: (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
Arguments
| :: (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 #
Arguments
| :: (HasCallStack, MonadIO m, IsCookieJar a) | |
| => a |
|
| -> Cookie |
|
| -> m () |
Deletes cookie from jar, emitting the 'changed' signal.
Since: 2.26
getAcceptPolicy
cookieJarGetAcceptPolicy Source #
Arguments
| :: (HasCallStack, MonadIO m, IsCookieJar a) | |
| => a |
|
| -> m CookieJarAcceptPolicy | Returns: the |
Gets jar's CookieJarAcceptPolicy
Since: 2.30
getCookieList
cookieJarGetCookieList Source #
Arguments
| :: (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
Arguments
| :: (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 #
Arguments
| :: (HasCallStack, MonadIO m, IsCookieJar a) | |
| => a |
|
| -> m Bool | Returns: |
Gets whether jar stores cookies persistenly.
Since: 2.40
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m CookieJar | Returns: a new |
save
Arguments
| :: (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 #
Arguments
| :: (HasCallStack, MonadIO m, IsCookieJar a) | |
| => a |
|
| -> CookieJarAcceptPolicy |
|
| -> m () |
Sets policy as the cookie acceptance policy for jar.
Since: 2.30
setCookie
Arguments
| :: (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 #
Arguments
| :: (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
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
setcookieJar [ #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 #
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
genClosure_CookieJarChanged :: MonadIO m => CookieJarChangedCallback -> m (GClosure C_CookieJarChangedCallback) Source #
Wrap the callback into a GClosure.
mk_CookieJarChangedCallback :: C_CookieJarChangedCallback -> IO (FunPtr C_CookieJarChangedCallback) Source #
Generate a function pointer callable from C code, from a C_CookieJarChangedCallback.
noCookieJarChangedCallback :: Maybe CookieJarChangedCallback Source #
A convenience synonym for .Nothing :: Maybe CookieJarChangedCallback
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