The current request's session (req.session).
More...
#include <SessionManager.hpp>
|
| const std::string & | id () const |
| |
| bool | is_new () const |
| | True if this request created the session.
|
| |
| std::optional< std::string > | get (const std::string &key) const |
| |
| void | set (const std::string &key, std::string value) |
| |
| void | erase (const std::string &key) |
| |
| const SessionData & | data () const |
| |
| void | regenerate () |
| | Issues a new ID and keeps the data; the old ID stops working.
|
| |
| void | destroy () |
| | Deletes the session and expires the cookie.
|
| |
The current request's session (req.session).
Changes are saved when the response is sent. Call regenerate() after a login or privilege change, so an ID known before login (session fixation) becomes useless, and destroy() on logout.
◆ data()
| const SessionData & orbit::middleware::Session::data |
( |
| ) |
const |
|
inline |
◆ destroy()
| void orbit::middleware::Session::destroy |
( |
| ) |
|
Deletes the session and expires the cookie.
◆ erase()
| void orbit::middleware::Session::erase |
( |
const std::string & |
key | ) |
|
◆ get()
| std::optional< std::string > orbit::middleware::Session::get |
( |
const std::string & |
key | ) |
const |
◆ id()
| const std::string & orbit::middleware::Session::id |
( |
| ) |
const |
|
inline |
◆ is_new()
| bool orbit::middleware::Session::is_new |
( |
| ) |
const |
|
inline |
True if this request created the session.
◆ regenerate()
| void orbit::middleware::Session::regenerate |
( |
| ) |
|
Issues a new ID and keeps the data; the old ID stops working.
◆ set()
| void orbit::middleware::Session::set |
( |
const std::string & |
key, |
|
|
std::string |
value |
|
) |
| |
◆ SessionManager
◆ data_
◆ destroyed_
| bool orbit::middleware::Session::destroyed_ = false |
|
private |
◆ dirty_
| bool orbit::middleware::Session::dirty_ = false |
|
private |
◆ id_
| std::string orbit::middleware::Session::id_ |
|
private |
◆ is_new_
| bool orbit::middleware::Session::is_new_ = false |
|
private |
◆ previous_id_
| std::string orbit::middleware::Session::previous_id_ |
|
private |
The documentation for this class was generated from the following file: