File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -514,6 +514,7 @@ fn parse_cookie_list(cookie_string) {
514
514
/// Fetch the cookies sent in a request.
515
515
///
516
516
/// Note badly formed cookie pairs will be ignored.
517
+ /// RFC6265 specifies that invalid cookie names/attributes should be ignored.
517
518
pub fn get_req_cookies(req) -> List(tuple(String, String)) {
518
519
let Request(headers: headers, ..) = req
519
520
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ pub fn empty_attributes() {
39
39
}
40
40
41
41
/// Helper to create sensible default attributes for a set cookie.
42
+ ///
43
+ /// NOTE these defaults ensure you cookie is always available to you application.
44
+ /// However this is not a fully secure solution.
45
+ /// You should consider setting a Secure and/or SameSite attribute.
46
+ ///
47
+ /// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#Attributes
42
48
pub fn default_attributes ( ) {
43
49
Attributes (
44
50
max_age : option . None ,
You can’t perform that action at this time.
0 commit comments