#pragma once #include "http_define.h" #if USE_NET_HTTP_WEBSITE #include #include #include #include "util/counter.hpp" namespace ylib { namespace network { namespace http { class website; class server; /// /// 会话数据 /// class session { public: session(); ~session(); /// /// 初始化 /// /// void init(network::http::website* website,const std::string& id); /// /// 唯一ID /// /// std::string id(); /// /// 更新(防止过期) /// void update(); /// /// 置数据 /// /// /// void set(const std::string& name,const std::string& value); /// /// 读数据 /// /// /// std::string get(const std::string& name); /// /// 校验是否过期 /// /// bool check(); private: // 唯一ID std::string m_id; // 网站 network::http::website* m_website = nullptr; }; } } } #endif