From 6a8cb061bd78dcec86ab203d4c0e81401be425a8 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 1 Aug 2014 02:53:52 +0200 Subject: Fixing HTTP server's cooking handling. --- src/HttpServer.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 917fc8b..d6bc53d 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -403,11 +403,14 @@ bool Balau::HttpWorker::handleClient() { String value = line.extract(colon + 1); if (key == "Cookie") { - int equal = value.strchr('='); - if (equal > 0) { - key = value.extract(0, equal).trim(); - value = value.extract(equal + 1).trim(); - cookies[key] = value; + String::List cookiesStrs = value.split(';'); + for (auto & value: cookiesStrs) { + int equal = value.strchr('='); + if (equal > 0) { + key = value.extract(0, equal).trim(); + value = value.extract(equal + 1).trim(); + cookies[key] = value; + } } } else { httpHeaders[key] = value.trim(); -- cgit v1.2.3