Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
SessionManager.hpp File Reference
#include <orbit/legacy_namespaces.hpp>
#include <chrono>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <unordered_map>
#include <orbit/http/HttpRequest.hpp>
#include <orbit/http/ResponseWriter.hpp>
Include dependency graph for SessionManager.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  orbit::middleware::SessionStore
 Where sessions live. Implementations must be thread-safe. More...
 
class  orbit::middleware::MemorySessionStore
 In-process store. Fine for a single server; sessions are lost on restart and not shared between instances (use RedisSessionStore). More...
 
struct  orbit::middleware::MemorySessionStore::Entry
 
class  orbit::middleware::Session
 The current request's session (req.session). More...
 
struct  orbit::middleware::SessionOptions
 
class  orbit::middleware::SessionManager
 Loads or creates the session for each request (req.session, req.session_id) and saves it when the response is sent. More...
 

Namespaces

namespace  orbit
 
namespace  orbit::middleware
 

Typedefs

using orbit::middleware::SessionData = std::unordered_map< std::string, std::string >
 Key/value data kept for one session.
 

Functions

auto orbit::middleware::session (std::shared_ptr< SessionStore > store, SessionOptions options={})
 Session middleware over any store, e.g. std::make_shared<MemorySessionStore>().