HttpCookie.Jar.Server (http_cookie v0.9.0)

View Source

HTTP Cookie Jar Server

Thin GenServer wrapper around HttpCookie.Jar. This is a convenience to enable usage with HTTP clients which don't have a way to store and pass back the updated jar.

Summary

Functions

Returns a specification to start this module under a supervisor.

Formats the cookie for sending in a request header for the provided URL.

Returns the internal cookie jar.

Processes the response header list for the given request URL. Parses set-cookie headers and stores valid cookies.

Starts the jar server.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

put_cookies_from_headers(pid, request_url, headers)

@spec put_cookies_from_headers(
  pid :: pid(),
  request_url :: URI.t(),
  headers :: list()
) ::
  HttpCookie.Jar.t()

Processes the response header list for the given request URL. Parses set-cookie headers and stores valid cookies.

start_link(opts \\ [])

@spec start_link(opts :: keyword()) :: {:ok, pid()}

Starts the jar server.