actix / actix/actix-web

Can't set a signed cookie or a CookieJar

オープン
#2,465 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
A-web C-feature
主要言語
Rust
スター
24.8k
フォーク
1.9k
平均マージ
23時間 10分
マージ済み PR(30日)
26

説明

~Your issue may already be reported!
Please search on the [Actix Web issue tracker](https://github.com/actix/actix-web/issues) before creating one.~
Searched ✔️

## Expected Behavior

be able to set a signed cookie.

## Current Behavior

When trying to set a cookie (using `res_builder.cookie(...)`) it always uses `CookieJar::new()` (from source) leaving the user unable to set anything differently. When using `actix-identity` or `actix-session` it allows setting a signed cookie, but it might be too much of a stretch just to set a single cookie.

## Possible Solution

- Add a method to get/set cookie jar. To be able to use a `SignedJar` for instance.
Or
- Add a method to add signed cookies using a configuration. Just like `QueryConfig` does.

## Context

I was trying to set a trivial cookie that I don't want the end user to be able to modify it, but ended up using a lot of time trying, reading, and it ended up being way harder than I think it should be.

## Your Environment

```toml
actix = "0.10"
actix-web = "3.3"
actix-web-actors = "3.0"
actix-identity = "0.3"
```
* Rust Version (I.e, output of `rustc -V`): `rustc 1.56.1 (59eed8a2a 2021-11-01)`
* Actix Web Version: `3.3.2`

PS: This is my first time using `actix-web` so if there was something that I missed please advise.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。