Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
cookie_entity.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <ctime>
5 #include "entity.h"
6 
14 class CookieEntity : public Entity {
15  std::string value;
16  std::time_t expires;
17  size_t maxAge_sec;
18  std::string domain;
19  std::string path;
20  bool httpOnly;
21 public:
39  explicit CookieEntity(
40  const char * value,
41  time_t expires = -1,
42  size_t maxAge_sec = std::string::npos,
43  const char * domain = nullptr,
44  const char * path = nullptr,
45  bool httpOnly = false
46  );
47 
54  void setValue(std::string value) override;
55 
62  std::string toString() override;
63 
70  std::unique_ptr<Entity> clone() override;
71 };
std::string toString() override
CookieEntity(const char *value, time_t expires=-1, size_t maxAge_sec=std::string::npos, const char *domain=nullptr, const char *path=nullptr, bool httpOnly=false)
Class wrapper for Cookies. Allow you adjust parameters od each http cookie. Used by CookieMiddleware...
Definition: cookie_entity.h:14
std::unique_ptr< Entity > clone() override
void setValue(std::string value) override
Cloneable interface of object wth value and serializable method.
Definition: entity.h:10