module Amber::Router::Cookies::HeaderParser

Overview

Reads a request's Cookie header in one pass, and finds the same cookies HTTP::Cookies.from_client_headers finds. Sessions and CSRF read cookies here, and an app may read request.cookies, so both must agree on a repeated name.

Pairs are separated by ; . Text after a bare ; is ignored up to the next ; . A pair with an invalid name or value is left out and the pairs around it still count, so one malformed cookie from a client never fails a request.

Defined in:

amber/router/cookies/header_parser.cr

Class Method Summary

Class Method Detail

def self.each_cookie(header : String, & : HTTP::Cookie -> ) : Nil #

[View source]