#include "HTTPSession.h"
#include <uuid/uuid.h>

namespace http {

   HTTPSession::HTTPSession() {
      generateSessionId();
   }

   HTTPSession::HTTPSession(coreutils::ZString sessionId) {
      strncpy(this->sessionId, sessionId.getData(), 37);
   }

   coreutils::ZString HTTPSession::getSessionId() {
      return coreutils::ZString(sessionId, 37);
   }

   int HTTPSession::generateSessionId() {
      uuid_t uuid;
      uuid_generate_random(uuid);
      uuid_unparse(uuid, sessionId);
      return 0;
   }

}

