Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewolson/purescript-biscotti-cookie
Utilities for parsing and generating cookie headers in PureScript
https://github.com/drewolson/purescript-biscotti-cookie
Last synced: about 1 month ago
JSON representation
Utilities for parsing and generating cookie headers in PureScript
- Host: GitHub
- URL: https://github.com/drewolson/purescript-biscotti-cookie
- Owner: drewolson
- Created: 2019-08-29T02:03:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T22:44:33.000Z (almost 2 years ago)
- Last Synced: 2024-05-09T21:50:00.845Z (8 months ago)
- Language: PureScript
- Size: 197 KB
- Stars: 5
- Watchers: 3
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# purescript-biscotti-cookie
[![Build
Status](https://github.com/drewolson/purescript-biscotti-cookie/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/drewolson/purescript-biscotti-cookie/actions/workflows/test.yml)Documentation is available on
[Pursuit](https://pursuit.purescript.org/packages/purescript-biscotti-cookie).This library allows parsing and generating cookie headers. You'll generally use
the `Cookie.new` function to create a cookie from a name/value pair and the
`Cookie.set*` functions to set attributes on a cookie.`Cookie.stringify` generates the string representation of a cookie, suitable for
writing to an HTTP header.`Cookie.parse` parses the string representation of a cookie, returning an
`Either ParseError Cookie`.```purescript
import Biscotti.Cookie as Cookie> Cookie.stringify $ Cookie.setSecure $ Cookie.new "key" "value"
key=value; Secure> Cookie.parse "key=value; Secure"
(Right { domain: Nothing, expires: Nothing, httpOnly: false, maxAge: Nothing, name: "key", path: Nothing, secure: true, value: "value" })
```## Running the tests
```text
spago test
```## License
MIT