# \#cookie

**URL:** https://discuss.ocaml.org/tag/cookie/373.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [\[Ask\] Cookie Crypto](https://discuss.ocaml.org/t/ask-cookie-crypto/10376)

<div class="topic-metadata">

**Author:** [@mro](https://discuss.ocaml.org/u/mro)\
**Replies:** 5\
**Last updated:** [August 28, 2022, 3:41am UTC](https://discuss.ocaml.org/t/ask-cookie-crypto/10376 "2022-08-28T03:41:30Z")

</div>

for a CGI I need to encrypt a cookie header payload like let encrypt sec nonce adata = assert (32 = (sec |\> Cstruct.length)); assert (12 = (nonce |\> Cstruct.length)); let key = sec |\> Mirage\_crypto.Chacha20.of\_sec…

---

## [How to set Cookie with Opium?](https://discuss.ocaml.org/t/how-to-set-cookie-with-opium/5808)

<div class="topic-metadata">

**Author:** [@koji-k](https://discuss.ocaml.org/u/koji-k)\
**Replies:** 1\
**Last updated:** [May 20, 2020, 8:48am UTC](https://discuss.ocaml.org/t/how-to-set-cookie-with-opium/5808 "2020-05-20T08:48:50Z")

</div>

I try to use Cookie with Opium. sample code explains how to use Cookie module. Therefore i wrote a following code. let test = get "/auth/test" begin fun (\_req: Request.t) -\> \`String "aaa" |\> respond |\> Coo…
