mirror of https://github.com/rwf2/Rocket.git
Fix the 'user_id' route in cookies guide.
This commit is contained in:
parent
362afdc445
commit
6d3cd374ac
|
@ -402,9 +402,8 @@ methods are suffixed with `_private`. These methods are: [`get_private`],
|
|||
/// Retrieve the user's ID, if any.
|
||||
#[get("/user_id")]
|
||||
fn user_id(cookies: Cookies) -> Option<String> {
|
||||
request.cookies()
|
||||
.get_private("user_id")
|
||||
.map(|cookie| format!("User ID: {}", cookie.value()))
|
||||
cookies.get_private("user_id")
|
||||
.map(|cookie| format!("User ID: {}", cookie.value()))
|
||||
}
|
||||
|
||||
/// Remove the `user_id` cookie.
|
||||
|
|
Loading…
Reference in New Issue