|
Malloy
|
Public Member Functions | |
| manager (std::shared_ptr< storage > storage) | |
| manager (const manager &other)=delete | |
| manager (manager &&other) noexcept=delete | |
| virtual | ~manager ()=default |
| manager & | operator= (const manager &rhs)=delete |
| manager & | operator= (manager &&rhs) noexcept=delete |
| std::shared_ptr< session > | get (const request_header<> &hdr) |
| std::shared_ptr< session > | get (const request<> &req) |
| std::shared_ptr< session > | get (const id_type &id) |
| std::shared_ptr< session > | start (const request<> &req, response<> &resp) |
| void | destroy (const request<> &req, response<> &resp) |
| std::size_t | destroy_expired (const std::chrono::seconds &max_lifetime) |
| bool | is_valid (const request<> &req) |
| bool | is_valid (const malloy::http::request_header<> &hdr) |
| bool | is_valid (const id_type &id) |
Static Public Attributes | |
| static constexpr const char * | cookie_name = "sessionId" |
|
explicit |
Constructor.
This will throw std::invalid_argument if no valid storage is provided.
| storage | The session storage to use. |
|
delete |
Copy constructor.
| other |

|
deletenoexcept |
Move constructor.
| other |

|
virtualdefault |
Destructor.

Destroys an existing session.
| req | The request. |
| resp | The response. |

| std::size_t manager::destroy_expired | ( | const std::chrono::seconds & | max_lifetime | ) |
Destroys any sessions older than the specified max lifetime.
| max_lifetime | The maximum lifetime of a session. |
|
nodiscard |
Get an existing session (if any).
| id | The session ID. |
|
inlinenodiscard |
Get an existing session (if any).
| req | The HTTP request. |

|
nodiscard |
Get an existing session (if any).
| hdr | The HTTP request header. |

|
nodiscard |
Checks whether the session is valid.
| id | The session id. |

|
nodiscard |
Checks whether the session is valid.
| hdr | The request header. |

|
inlinenodiscard |
Checks whether the session is valid.
| req | The request. |

Copy assignment operator.
| rhs |

Move assignment operator.
| rhs |

Get an existing session (if any) or create a new one.
| req | The request. |
| resp | The response. |

|
staticconstexpr |
Name of the session cookie