cookie-tray: For serving cookies

[ apache, library, web ] [ Propose Tags ] [ Report a vulnerability ]

This package aims to make it easy to set cookies from your web server, even if you are not intimately familiar with the details of the Set-Cookie HTTP field.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.0
Change log changelog.md
Dependencies base (>=4.16 && <4.19), binary (>=0.8.9 && <0.9), bytestring (>=0.11.4 && <0.12), containers (>=0.6.5 && <0.7), cookie (>=0.4.6 && <0.5), time (>=1.11.1 && <1.13) [details]
License Apache-2.0
Author Chris Martin
Maintainer Chris Martin, Julie Moronuki
Category Web
Home page https://github.com/typeclasses/cookie-tray
Uploaded by chris_martin at 2023-06-22T20:21:41Z
Distributions NixOS:0.0.0.0
Downloads 67 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-06-22 [all 1 reports]

Readme for cookie-tray-0.0.0.0

[back to package description]

The cookie-tray package aims to make it easy to set cookies from your web server, even if you are not intimately familiar with the details of the Set-Cookie HTTP field.

One example of a higher-level abstraction provided by this library is the idea of cookie deletion. The low-level specification gives no way to explicitly instruct a client to unset a cookie. This library provides a Delete action that does the right thing (sets the cookie with an expiration date in the past) to achieve removal.


Currently the best way to see how the library is used is to look at the test suite.


I currently consider the API to be "experimental" because I don't think its chief goals of being convenient and instructive have been satisfied confidently enough to consider the library "finished." I am open to accepting improvements to make the library more convenient to use.


This package works nicely in conjunction with wai and warp. See mapResponseHeaders in WAI for how to apply fields to the response header.

I am not sure how one would use this with scotty, as you may be thwarted by Scotty's use of Text instead of ByteString to represent HTTP fields.


Reference documentation on cookies: