MCPcopy Create free account
hub / github.com/berthubert/trifecta / createSessionForUser

Method createSessionForUser

support.cc:317–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317string Sessions::createSessionForUser(const std::string& user, const std::string& agent, const std::string& ip, bool authenticated, std::optional<time_t> expire)
318{
319 string sessionid=makeShortID(getRandom64())+makeShortID(getRandom64());
320 d_lsqw.addValue({{"id", sessionid}, {"user", user}, {"agent", agent}, {"ip", ip}, {"createTstamp", time(0)},
321 {"lastUseTstamp", 0}, {"expireTstamp", expire.value_or(0)},
322 {"authenticated", (int)authenticated}}, "sessions");
323 return sessionid;
324}
325
326void Sessions::dropSession(const std::string& sessionid, std::optional<string> user)
327{

Callers 2

standardFunctionsMethod · 0.80
trifectaMainFunction · 0.80

Calls 3

makeShortIDFunction · 0.85
getRandom64Function · 0.85
addValueMethod · 0.80

Tested by

no test coverage detected