Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Session.hpp File Reference

Working with user session IDs. More...

#include <string>
#include "json/json.h"
Include dependency graph for Session.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 Myra
 Namespace declaration for all of the Myra Canyon helper functions.
 
 Myra::Session
 Manage session IDs. Used by the Myra Apache module to determine if a user has correctly logged in.
 

Functions

bool Myra::Session::remove_expired_sessions (Json::Value &root)
 Remove all exipred sessions. More...
 
Json::Value Myra::Session::read (void)
 Load all sessions. More...
 
void Myra::Session::write (const Json::Value &root)
 Write all sessions. More...
 
std::string Myra::Session::create_new_session (const std::string &username, const std::string &ip_address)
 Create a new session ID and immediately save to disk. More...
 
std::string Myra::Session::create_new_session (Json::Value &root, const std::string &username, const std::string &ip_address)
 Create a new session. The sessions are not saved to disk. Remember to call write(). More...
 
bool Myra::Session::delete_session (const std::string &session_id)
 Remove a session ID and immediately save to disk. More...
 
bool Myra::Session::delete_session (Json::Value &root, const std::string &session_id)
 Remove a session. This sessions are not saved to disk. Remember to call write(). More...
 
bool Myra::Session::is_valid_session (const std::string &session_id, const std::string &ip_address)
 Validate a session id and source IP address. More...
 
bool Myra::Session::is_valid_session (const Json::Value &root, const std::string &session_id, const std::string &ip_address)
 

Variables

const char *const Myra::Session::Filename = "/usr/share/myra/myra-session.json"
 Filename where session IDs are stored. More...
 

Detailed Description

Working with user session IDs.