本文整理汇总了C++中http_request::get_cookie方法的典型用法代码示例。如果您正苦于以下问题:C++ http_request::get_cookie方法的具体用法?C++ http_request::get_cookie怎么用?C++ http_request::get_cookie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http_request
的用法示例。
在下文中一共展示了http_request::get_cookie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render_DELETE
void resource_session::render_DELETE(http_request const & request, http_response * * const response)
{
auto session = request.get_cookie("session");
auto builder = http_response_builder{""};
if(session.length() && session_remove(m_redis, session))
{
builder = http_response_builder{kLogOutSuccess};
}
else
{
builder = http_response_builder{kLogOutFailure};
}
*response = new http_response{builder};
}
示例2: render_GET
void resource_session::render_GET(http_request const & request, http_response * * const response)
{
auto session = request.get_cookie("session");
auto builder = http_response_builder{""};
if(session.length() && session_exists(m_redis, session))
{
builder = http_response_builder{kValidSession};
}
else
{
builder = http_response_builder{kInvalidSession};
}
*response = new http_response{builder};
}