session_sid.h

来自「C++ web POSIX framewark」· C头文件 代码 · 共 47 行

H
47 行
字号
#ifndef CPPCMS_SESSION_SID_H#define CPPCMS_SESSION_SID_H#include <sys/time.h>#include <boost/shared_ptr.hpp>#include "session_api.h"namespace cppcms {	class session_server_storage;class session_interface;	namespace details {class sid_generator : public boost::noncopyable {	struct for_hash {		char uid[16];		uint64_t session_counter;		struct timeval tv;	} hashed;public:	sid_generator();	std::string operator()();};}class session_sid : public session_api {	details::sid_generator sid;	boost::shared_ptr<session_server_storage> storage;	bool cache;	std::string key(std::string sid);public:	bool valid_sid(std::string const &str);	session_sid(boost::shared_ptr<session_server_storage> s,bool c=false) :		storage(s),		cache(c)	{	}	virtual void save(session_interface *,std::string const &data,time_t timeout,bool);	virtual bool load(session_interface *,std::string &data,time_t &timeout);	virtual void clear(session_interface *);};}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?