Logtalk APIs Logo
3.101.0

Contents

  • Libraries
    • adaptive_boosting_classifier
    • agglomerative_clusterer
    • amqp
    • anomaly_detection_protocols
    • application
    • apriori_pattern_miner
    • arbitrary
    • arrangements
    • assertions
    • assignvars
    • avro
    • base32
    • base58
    • base64
    • base85
    • bayesian_ridge_regression
    • borda_ranker
    • bradley_terry_ranker
    • c45_classifier
    • cartesian_products
    • cbor
    • ccsds_frames
    • ccsds_link_profiles
    • ccsds_packet_services
    • ccsds_packetization
    • ccsds_packets
    • ccsds_tc_services
    • ccsds_time_codes
    • ccsds_time_fields
    • character_sets
    • classification_protocols
    • clo_span_pattern_miner
    • clustering_protocols
    • code_metrics
    • colley_ranker
    • combinations
    • command_line_options
    • copeland_ranker
    • core
    • coroutining
    • crs_projections
    • crypto
    • csv
    • cuid2
    • cusum_anomaly_detector
    • datalog
    • dates
    • dates_tz
    • dbscan_clusterer
    • dead_code_scanner
    • debug_messages
    • debugger
    • dependents
    • deques
    • derangements
    • diagrams
    • dictionaries
    • dif
    • dimension_reduction_protocols
    • doclet
    • eclat_pattern_miner
    • edcg
    • elastic_net_regression
    • elo_ranker
    • events
    • ewma_anomaly_detector
    • expand_library_alias_paths
    • expecteds
    • fcube
    • flags
    • format
    • fp_growth_pattern_miner
    • frequent_pattern_mining_protocols
    • gaussian_mixture_clusterer
    • gaussian_process_regression
    • genint
    • gensym
    • geohash
    • geojson
    • geospatial
    • git
    • glicko2_periodic_ranker
    • glicko2_ranker
    • gradient_boosting_classifier
    • gradient_boosting_regression
    • grammars
    • graphs
    • gravatar
    • gsp_pattern_miner
    • hashes
    • hdbscan_clusterer
    • heaps
    • help
    • hierarchical_clustering
    • hierarchies
    • hmac
    • hodge_rank
    • hook_flows
    • hook_objects
    • html
    • http_authenticate
    • http_client
    • http_client_core
    • http_cookies
    • http_core
    • http_cors
    • http_digest
    • http_directory_listing
    • http_htmx
    • http_multipart
    • http_parameters
    • http_process_transport
    • http_router
    • http_server
    • http_server_core
    • http_session
      • http_client_session
      • http_client_session(HTTPTransport)
      • http_cookie_jar
      • http_router_server_session(Manager)
      • http_server_core_session
      • http_server_core_session_handler(Manager,Handler)
    • http_socket_transport
    • http_static_files
    • http_websocket
    • http_websocket_frames
    • http_websocket_handshake
    • http_websocket_messages
    • http_websocket_service
    • http_websocket_session
    • ica_projection
    • ids
    • ieee_754
    • intervals
    • iqr_anomaly_detector
    • iso8601
    • iso_13616
    • iso_3166
    • iso_4217
    • iso_639
    • iso_9362
    • isolation_forest_anomaly_detector
    • issue_creator
    • java
    • json
    • json_graph
    • json_ld
    • json_lines
    • json_patch
    • json_path
    • json_pointer
    • json_rpc
    • json_schema
    • jwt
    • kcenters_clusterer
    • kemeny_young_ranker
    • kernel_pca_projection
    • kernel_svm_classifier
    • kmeans_clusterer
    • kmedians_clusterer
    • kmedoids_clusterer
    • kmodes_clusterer
    • knn_classifier
    • knn_distance_anomaly_detector
    • knn_regression
    • kprototypes_clusterer
    • ksuid
    • lasso_regression
    • lda_classifier
    • lda_projection
    • lgtdoc
    • lgtunit
    • library
    • linda
    • linear_algebra
    • linear_regression
    • linear_svm_classifier
    • linter_reporter
    • listing
    • lof_anomaly_detector
    • logging
    • logistic_regression_classifier
    • loops
    • massey_ranker
    • mcp_server
    • memcached
    • message_pack
    • meta
    • meta_compiler
    • metagol
    • mime_types
    • modified_z_score_anomaly_detector
    • multisets
    • mutation_testing
    • mutations
    • naive_bayes_classifier
    • nanoid
    • nearest_centroid_classifier
    • nested_dictionaries
    • nmea
    • nmf_projection
    • open_ai
    • open_api
    • open_id
    • optics_clusterer
    • optionals
    • options
    • os
    • otp
    • packs
    • partitions
    • pattern_mining_protocols
    • pca_projection
    • pddl_parser
    • permutations
    • plackett_luce_last_ranker
    • plackett_luce_ranker
    • pls_projection
    • ports_profiler
    • prefix_span_pattern_miner
    • probabilistic_pca_projection
    • process
    • protobuf
    • qda_classifier
    • queues
    • random
    • random_forest_classifier
    • random_forest_regression
    • random_projection
    • rank_centrality
    • ranked_pairs
    • ranking_protocols
    • reader
    • recorded_database
    • redis
    • regression_protocols
    • regression_tree
    • regularized_bradley_terry_ranker
    • rest
    • ridge_regression
    • s3
    • sarif
    • sbom
    • schulze_ranker
    • sequential_pattern_mining_protocols
    • sets
    • sgd_classifier
    • simulated_annealing
    • snowflakeid
    • sockets
    • spade_pattern_miner
    • statistics
    • stemming
    • stomp
    • string_distance
    • strings
    • subsequences
    • term_io
    • thurstone_mosteller_ranker
    • time_scales
    • timeout
    • tle_orbits
    • toml
    • tool_diagnostics
    • toon
    • toychr
    • truncated_svd_projection
    • tsv
    • tutor
    • types
    • tzif
    • ulid
    • union_find
    • url
    • uuid
    • validations
    • verdi_neruda
    • wkt_wkb
    • wrapper
    • xml_parser
    • yaml
    • z_score_anomaly_detector
    • zippers
  • Directories
  • Entities
  • Predicates
  • Core diagram
  • Libraries diagram
  • Tools diagram
  • Ports diagram
  • Contributions diagram
  • Index

External Contents

  • Handbook
  • Logtalk website
  • GitHub repo
Logtalk APIs
  • Libraries
  • http_cookie_jar
  • View page source

object

http_cookie_jar

HTTP cookie jar implementing explicit storage and request matching on top of the http_cookies parsing and generation predicates, with explicit save and load operations for persisting jar contents.

Availability:
logtalk_load(http_session(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-06-26
Compilation flags:
static, context_switching_calls
Imports:
public http_text_helpers
public http_origin_site_helpers
public options
Uses:
date
http_cookies(Representation)
list
os
url(Representation)
user
Remarks:
(none)
Inherited public predicates:
 check_option/1  check_options/1  default_option/1  default_options/1  option/2  option/3  valid_option/1  valid_options/1
  • Public predicates

    • open/1

    • open/2

    • close/1

    • clear/1

    • store_set_cookies/3

    • request_cookies/3

    • request_cookies/4

    • cookies/2

    • cookie_count/2

    • save/2

    • load/2

  • Protected predicates

  • Private predicates

    • jar_seed_/1

    • jar_state_/2

    • jar_cookie_/11

  • Operators

Public predicates

open/1

Opens a new empty cookie jar.

Compilation flags:
static
Template:
open(Jar)
Mode and number of proofs:
open(-compound) - one

open/2

Opens a new cookie jar using the given options list. Supported options include cookies_file(File) for preloading previously persisted cookies from disk.

Compilation flags:
static
Template:
open(Jar,Options)
Mode and number of proofs:
open(-compound,+list(compound)) - one_or_error
Exceptions:
Options is a variable or a partial list:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is neither a variable nor a compound term:
type_error(compound,Option)
An element Option of the list Options is a compound term but not a valid option:
domain_error(option,Option)
The cookies file option is a variable:
instantiation_error
The cookies file option is neither a variable nor an atom:
type_error(atom,File)
The persisted cookie data is malformed:
domain_error(http_cookie_jar_persisted_cookies,PersistedCookies)
A persisted cookie is malformed:
domain_error(http_cookie_jar_persisted_cookie,PersistedCookie)

close/1

Closes a cookie jar and removes all stored cookies.

Compilation flags:
static
Template:
close(Jar)
Mode and number of proofs:
close(+compound) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))

clear/1

Removes all currently stored cookies from a cookie jar while keeping the jar handle valid.

Compilation flags:
static
Template:
clear(Jar)
Mode and number of proofs:
clear(+compound) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))

store_set_cookies/3

Stores normalized Set-Cookie terms for the given absolute URL, replacing existing cookies with the same name, domain, and path.

Compilation flags:
static
Template:
store_set_cookies(Jar,URL,SetCookies)
Mode and number of proofs:
store_set_cookies(+compound,+atom,+list(compound)) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))
URL is a variable:
instantiation_error
URL is not a supported absolute cookie-jar URL:
domain_error(http_cookie_jar_url,URL)
URL uses an unsupported cookie-jar URL scheme:
domain_error(http_cookie_jar_url_scheme,Scheme)
SetCookies is a variable or a partial list:
instantiation_error
SetCookies is not a valid set-cookie list:
domain_error(http_cookie_jar_set_cookies,SetCookies)
An element SetCookie of SetCookies is not a valid normalized Set-Cookie term:
domain_error(http_cookie_jar_set_cookie,SetCookie)

request_cookies/3

Returns the cookie name-value pairs currently applicable to the given absolute URL using the convenience default request_context(get, source_url(URL), false).

Compilation flags:
static
Template:
request_cookies(Jar,URL,Cookies)
Mode and number of proofs:
request_cookies(+compound,+atom,-list(compound)) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))
URL is a variable:
instantiation_error
URL is not a supported absolute cookie-jar URL:
domain_error(http_cookie_jar_url,URL)
URL uses an unsupported cookie-jar URL scheme:
domain_error(http_cookie_jar_url_scheme,Scheme)

request_cookies/4

Returns the cookie name-value pairs currently applicable to the given absolute URL for an explicit request context represented as request_context(Method, Source, TopLevelNavigation) where Source is either source_url(URL) for an absolute HTTP or HTTPS URL or source_origin(Origin) for a bare Origin header value.

Compilation flags:
static
Template:
request_cookies(Jar,URL,RequestContext,Cookies)
Mode and number of proofs:
request_cookies(+compound,+atom,+compound,-list(compound)) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))
URL is a variable:
instantiation_error
URL is not a supported absolute cookie-jar URL:
domain_error(http_cookie_jar_url,URL)
URL uses an unsupported cookie-jar URL scheme:
domain_error(http_cookie_jar_url_scheme,Scheme)
RequestContext is not a valid cookie-jar request context:
domain_error(http_cookie_jar_request_context,RequestContext)
RequestContext contains an invalid method:
type_error(atom,Method)
RequestContext contains an invalid source:
domain_error(http_cookie_jar_request_source,Source)
RequestContext contains an invalid top-level-navigation flag:
domain_error(boolean,TopLevelNavigation)

cookies/2

Returns the currently stored cookies as cookie(Name, Value, Attributes) terms.

Compilation flags:
static
Template:
cookies(Jar,Cookies)
Mode and number of proofs:
cookies(+compound,-list(compound)) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))

cookie_count/2

Returns the number of currently stored cookies.

Compilation flags:
static
Template:
cookie_count(Jar,Count)
Mode and number of proofs:
cookie_count(+compound,-integer) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))

save/2

Persists the currently stored cookies to a file using a canonical Logtalk term representation.

Compilation flags:
static
Template:
save(Jar,File)
Mode and number of proofs:
save(+compound,+atom) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))
File is a variable:
instantiation_error
File is neither a variable nor an atom:
type_error(atom,File)

load/2

Loads previously persisted cookies from a file, replacing the current jar contents.

Compilation flags:
static
Template:
load(Jar,File)
Mode and number of proofs:
load(+compound,+atom) - one_or_error
Exceptions:
Jar is a variable:
instantiation_error
Jar is neither a variable nor an open cookie-jar handle:
domain_error(http_cookie_jar,Jar)
Jar refers to a closed cookie-jar handle:
existence_error(http_cookie_jar,cookie_jar(JarId))
File is a variable:
instantiation_error
File is neither a variable nor an atom:
type_error(atom,File)
The persisted cookie data is malformed:
domain_error(http_cookie_jar_persisted_cookies,PersistedCookies)
A persisted cookie is malformed:
domain_error(http_cookie_jar_persisted_cookie,PersistedCookie)

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

jar_seed_/1

Last allocated cookie jar identifier.

Compilation flags:
dynamic
Template:
jar_seed_(JarId)
Mode and number of proofs:
jar_seed_(?positive_integer) - zero_or_one

jar_state_/2

Per-jar creation index counter state.

Compilation flags:
dynamic
Template:
jar_state_(JarId,CreationIndex)
Mode and number of proofs:
jar_state_(?positive_integer,?non_negative_integer) - zero_or_more

jar_cookie_/11

Stored cookie entries indexed by jar identifier.

Compilation flags:
dynamic
Template:
jar_cookie_(JarId,Name,Domain,Path,Value,HostOnly,Secure,HttpOnly,SameSite,Expiry,CreationIndex)
Mode and number of proofs:
jar_cookie_(?positive_integer,?atom,?atom,?atom,?atom,?boolean,?boolean,?boolean,?nonvar,?nonvar,?positive_integer) - zero_or_more

Operators

(none)

Previous Next

© Copyright 1998-2026, Paulo Moura.

Built with Sphinx using a theme provided by Read the Docs.