Module cookie

Source
Expand description

Everything you need to work with HTTP cookies.

§Guide

Check out the “Cookies” section of Pavex’s guide for a thorough introduction to cookies.

§Implementation details

Most types and functions are re-exports of the biscotti@0.3 crate.

Modules§

config
Configuration for a Processor.
errors
Errors that can occur when working with cookies.
request
Low-level types related to RequestCookies.
response
Low-level types related to ResponseCookies.

Structs§

Key
A cryptographic master key to sign or encrypt cookies.
Processor
Transforms cookies before they are sent to the client, or after they have been parsed from an incoming request.
ProcessorConfig
Config specifies how the server should handle incoming and outgoing cookies with respect to security and encoding.
RemovalCookie
A ResponseCookie that, when sent to the client, removes a cookie with the same ResponseCookieId from the client’s machine, if it exists.
RequestCookie
A cookie set by a client in an HTTP request using the Cookie header.
RequestCookies
A collection of RequestCookies attached to an HTTP request using the Cookie header.
ResponseCookie
A cookie set by a server in an HTTP response using the Set-Cookie header.
ResponseCookieId
A unique identifier for a ResponseCookie.
ResponseCookies
A collection of ResponseCookies to be attached to an HTTP response using the Set-Cookie header.

Enums§

Expiration
A cookie’s expiration: either a date-time or session.
SameSite
The SameSite cookie attribute.

Constants§

CONFIG_INTO_PROCESSOR
A handle to add [config_into_processor()] as a constructor to your Pavex application.
INJECT_RESPONSE_COOKIES
A handle to add inject_response_cookies() as a post-processing middleware to your Pavex application.
PROCESSOR_CONFIG
A strongly-typed id to register ProcessorConfig as a configuration type to your Pavex application.

Functions§

extract_request_cookies
Parse cookies out of the incoming request.
inject_response_cookies
Attach cookies to the outgoing response.