mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 05:45:08 +00:00
Browser: Show SameSite attribute in cookie storage inspector
This commit is contained in:
parent
b08ae57b23
commit
cb480fa3dc
3 changed files with 7 additions and 1 deletions
|
@ -99,6 +99,7 @@ void CookieJar::dump_cookies() const
|
||||||
builder.appendff("\t{}HttpOnly{} = {:s}\n", attribute_color, no_color, cookie.value.http_only);
|
builder.appendff("\t{}HttpOnly{} = {:s}\n", attribute_color, no_color, cookie.value.http_only);
|
||||||
builder.appendff("\t{}HostOnly{} = {:s}\n", attribute_color, no_color, cookie.value.host_only);
|
builder.appendff("\t{}HostOnly{} = {:s}\n", attribute_color, no_color, cookie.value.host_only);
|
||||||
builder.appendff("\t{}Persistent{} = {:s}\n", attribute_color, no_color, cookie.value.persistent);
|
builder.appendff("\t{}Persistent{} = {:s}\n", attribute_color, no_color, cookie.value.persistent);
|
||||||
|
builder.appendff("\t{}SameSite{} = {:s}\n", attribute_color, no_color, Web::Cookie::same_site_to_string(cookie.value.same_site));
|
||||||
}
|
}
|
||||||
|
|
||||||
dbgln("{}", builder.build());
|
dbgln("{}", builder.build());
|
||||||
|
@ -199,7 +200,7 @@ void CookieJar::store_cookie(Web::Cookie::ParsedCookie const& parsed_cookie, con
|
||||||
// https://tools.ietf.org/html/rfc6265#section-5.3
|
// https://tools.ietf.org/html/rfc6265#section-5.3
|
||||||
|
|
||||||
// 2. Create a new cookie with name cookie-name, value cookie-value. Set the creation-time and the last-access-time to the current date and time.
|
// 2. Create a new cookie with name cookie-name, value cookie-value. Set the creation-time and the last-access-time to the current date and time.
|
||||||
Web::Cookie::Cookie cookie { parsed_cookie.name, parsed_cookie.value };
|
Web::Cookie::Cookie cookie { parsed_cookie.name, parsed_cookie.value, parsed_cookie.same_site_attribute };
|
||||||
cookie.creation_time = Core::DateTime::now();
|
cookie.creation_time = Core::DateTime::now();
|
||||||
cookie.last_access_time = cookie.creation_time;
|
cookie.last_access_time = cookie.creation_time;
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ String CookiesModel::column_name(int column) const
|
||||||
return "Value";
|
return "Value";
|
||||||
case Column::ExpiryTime:
|
case Column::ExpiryTime:
|
||||||
return "Expiry time";
|
return "Expiry time";
|
||||||
|
case Column::SameSite:
|
||||||
|
return "SameSite";
|
||||||
case Column::__Count:
|
case Column::__Count:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -79,6 +81,8 @@ GUI::Variant CookiesModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
|
||||||
return cookie.value;
|
return cookie.value;
|
||||||
case Column::ExpiryTime:
|
case Column::ExpiryTime:
|
||||||
return cookie.expiry_time.to_string();
|
return cookie.expiry_time.to_string();
|
||||||
|
case Column::SameSite:
|
||||||
|
return Web::Cookie::same_site_to_string(cookie.same_site);
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
|
@ -22,6 +22,7 @@ public:
|
||||||
Name,
|
Name,
|
||||||
Value,
|
Value,
|
||||||
ExpiryTime,
|
ExpiryTime,
|
||||||
|
SameSite,
|
||||||
__Count,
|
__Count,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue