![]() |
boost::taar::handler::session_key::cookie — Session key carried in a cookie.
// In header: <boost/taar/handler/session_key.hpp> struct cookie { // public member functions explicit cookie(std::string, std::string = "Path=/; HttpOnly; SameSite=Lax"); std::optional< std::string > extract(boost::beast::http::request_header<> const &) const; template<typename Body, typename Fields> void attach(boost::beast::http::response< Body, Fields > &, std::string const &) const; chunked_set_header key_header(std::string const &) const; // public data members std::string name; std::string attributes; };
extract scans every Cookie header for name. attach adds a Set-Cookie header with the given attributes. The default attributes are Path=/; HttpOnly; SameSite=Lax; add Secure when serving over TLS.
cookie public member functionsexplicit cookie(std::string name, std::string attributes = "Path=/; HttpOnly; SameSite=Lax");
std::optional< std::string > extract(boost::beast::http::request_header<> const & request) const;
template<typename Body, typename Fields> void attach(boost::beast::http::response< Body, Fields > & response, std::string const & key) const;
chunked_set_header key_header(std::string const & key) const;The same
Set-Cookie header as a token for a chunked_response.