Full C++23 framework tree: runtime, observability, security, data, app, realtime, supervisor, clients, CLI, example plus enterprise tenancy, audit, operability, governance, supplychain. Postgres via docker compose for tests.
18 lines
687 B
C++
18 lines
687 B
C++
// Route: GET /sessions/counter (signed cookie session)
|
|
#include "support/Assert.hpp"
|
|
|
|
using namespace molo::example::test;
|
|
|
|
int main() {
|
|
Fixture f;
|
|
auto first = f.client->get("/sessions/counter");
|
|
check(first.status == 200, "status 200");
|
|
check(contains(first.body, "\"count\":1"), "counter starts at 1");
|
|
check(contains(first.body, "\"fresh\":true"), "first visit is fresh");
|
|
check(first.headers.has("Set-Cookie"), "session cookie set");
|
|
auto second = f.client->get("/sessions/counter");
|
|
check(contains(second.body, "\"count\":2"), "jar keeps session");
|
|
check(contains(second.body, "\"fresh\":false"), "second visit resumes");
|
|
return finish("sessions/counter");
|
|
}
|