| 273 | } |
| 274 | |
| 275 | std::string CookieCache::GetValidCookiesAsString() { |
| 276 | const std::lock_guard<std::mutex> guard(mutex_); |
| 277 | |
| 278 | DiscardExpiredCookies(); |
| 279 | if (cookies.empty()) { |
| 280 | return ""; |
| 281 | } |
| 282 | |
| 283 | std::string cookie_string = cookies.begin()->second.AsCookieString(); |
| 284 | for (auto it = (++cookies.begin()); cookies.end() != it; ++it) { |
| 285 | cookie_string += "; " + it->second.AsCookieString(); |
| 286 | } |
| 287 | return cookie_string; |
| 288 | } |
| 289 | |
| 290 | } // namespace internal |
| 291 | } // namespace flight |