| 315 | } |
| 316 | |
| 317 | string 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 | |
| 326 | void Sessions::dropSession(const std::string& sessionid, std::optional<string> user) |
| 327 | { |
no test coverage detected