删除session
This commit is contained in:
@@ -15,10 +15,6 @@ dir=${www}
|
||||
default_404=page/404.html
|
||||
; 默认首页(index.html,index.htm,index.lua)
|
||||
default_index=index.html
|
||||
; SESSION保存目录
|
||||
session_dir=${base}/session
|
||||
; SESSION默认过期时间
|
||||
session_timeout_sec=86400
|
||||
; 初始化加载脚本(网站程序启动)
|
||||
Initialization_script=
|
||||
; 调试模式,开启后启用LUA错误信息 (0=关闭 1=开启)
|
||||
|
||||
@@ -85,8 +85,6 @@ bool fastweb::app::start(const std::string& config_filepath)
|
||||
|
||||
ws_config.router.threadpool.size = 10;
|
||||
ws_config.router.threadpool.queuemax = 10000;
|
||||
ws_config.session.dirpath = this->config->website.session_dir;
|
||||
ws_config.session.timeout_sec = this->config->website.session_timeout_sec;
|
||||
config.website.push_back(ws_config);
|
||||
for_iter(iter, this->config->domain)
|
||||
{
|
||||
|
||||
@@ -75,8 +75,6 @@ void fastweb::config::cache()
|
||||
#endif
|
||||
website.default_404 = m_ini.read("website", "default_404");
|
||||
website.default_index = strutils::split(m_ini.read("website", "default_index"), ',');
|
||||
website.session_dir = PATH_EX(m_ini.read("website", "session_dir"));
|
||||
website.session_timeout_sec = ylib::stoi(m_ini.read("website", "session_timeout_sec"));
|
||||
website.Initialization_script = m_ini.read("website", "Initialization_script");
|
||||
website.debug = m_ini.read("website", "debug") == "1";
|
||||
website.domain = strutils::split(m_ini.read("website", "domain"),',');
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace fastweb
|
||||
std::string dir;
|
||||
std::string default_404;
|
||||
std::vector<std::string> default_index;
|
||||
std::string session_dir;
|
||||
uint32 session_timeout_sec;
|
||||
std::string Initialization_script;
|
||||
bool debug = false;
|
||||
std::vector<std::string> domain;
|
||||
|
||||
@@ -29,7 +29,6 @@ If you have any questions, please contact us: 1585346868@qq.com Or visit our web
|
||||
|
||||
#include "module/http/request.h"
|
||||
#include "module/http/response.h"
|
||||
#include "module/http/session.h"
|
||||
#include "module/http/httpclient.h"
|
||||
#include "module/http/interceptor.h"
|
||||
#include "module/http/subscribe.h"
|
||||
@@ -197,7 +196,6 @@ void fastweb::module_manager::load_core(sol::state* lua)
|
||||
module::response::regist(lua);
|
||||
module::interceptor::regist(lua);
|
||||
module::subscribe::regist(lua);
|
||||
module::session::regist(lua);
|
||||
module::httpclient::regist(lua);
|
||||
module::globalfuncs::regist(lua);
|
||||
module::mutex::regist(lua);
|
||||
|
||||
@@ -17,20 +17,11 @@ If you have any questions, please contact us: 1585346868@qq.com Or visit our web
|
||||
|
||||
#include "request.h"
|
||||
#include "net/http_reqpack.h"
|
||||
#include "session.h"
|
||||
module::request::request(network::http::request* request) :m_request(request)
|
||||
{
|
||||
}
|
||||
module::request::~request()
|
||||
{
|
||||
if (m_session != nullptr)
|
||||
delete m_session;
|
||||
}
|
||||
module::session* module::request::session(const std::string& token)
|
||||
{
|
||||
if (m_session == nullptr)
|
||||
m_session = new module::session(&m_request->session(token));
|
||||
return m_session;
|
||||
}
|
||||
sol::table module::request::body_param(sol::this_state s)
|
||||
{
|
||||
@@ -165,7 +156,6 @@ void module::request::regist(sol::state* lua)
|
||||
"remote_ipaddress", &module::request::remote_ipaddress,
|
||||
"remote_port", &module::request::remote_port,
|
||||
"param", &module::request::param,
|
||||
"session", &module::request::session,
|
||||
"body_param", &module::request::body_param,
|
||||
"url_param", &module::request::url_param,
|
||||
"body", &module::request::body,
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "core/define.h"
|
||||
namespace module
|
||||
{
|
||||
class session;
|
||||
class request
|
||||
{
|
||||
public:
|
||||
@@ -57,12 +56,6 @@ namespace module
|
||||
/// <returns></returns>
|
||||
ushort remote_port();
|
||||
/// <summary>
|
||||
/// 取session
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
module::session* session(const std::string& token);
|
||||
/// <summary>
|
||||
/// 取body参数
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
@@ -129,8 +122,6 @@ namespace module
|
||||
bool request_param(const std::string& name, std::string& value);
|
||||
private:
|
||||
network::http::request* m_request = nullptr;
|
||||
module::session* m_session = nullptr;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user