Skip to content

Static lifetimes in signed / private cookies

Compare
Choose a tag to compare
@imbolc imbolc released this 09 Jun 18:38
· 13 commits to main since this release

Before this commit, the Key that's passed to Cookies::signed() or Cookies::private() is forced to have a static lifetime, because the returned Cookie gets self's lifetime as its lifetime parameter. Now the Cookie gets static lifetime instead.

This makes it possible e.g. to store Key in an axum Extension layer instead of a global Cell.

Thank you @akheron 🙏