mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added get_or_create_session helper to Request.
This commit is contained in:
parent
0b0d2e5046
commit
711d1eed6f
@ -5,6 +5,18 @@
|
||||
|
||||
#include "http_session.h"
|
||||
|
||||
#include "session_manager.h"
|
||||
|
||||
HTTPSession *Request::get_or_create_session() {
|
||||
if (session) {
|
||||
return session;
|
||||
}
|
||||
|
||||
session = SessionManager::get_singleton()->create_session();
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
const std::string &Request::get_cookie(const std::string &key) {
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,8 @@ public:
|
||||
HTTPSession *session;
|
||||
std::map<std::string, Object *> data;
|
||||
|
||||
HTTPSession *get_or_create_session();
|
||||
|
||||
virtual const std::string &get_cookie(const std::string &key);
|
||||
virtual void add_cookie(const ::Cookie &cookie);
|
||||
virtual void remove_cookie(const std::string &key);
|
||||
|
Loading…
Reference in New Issue
Block a user