Sessionizer

Interacts with user client about session cookie, and enriches context with this cookie.

What it does

When this service is hit, it will determine if the visitor has a known session cookie. If it doesn't, it'll assign one. The cookie will be put for underlying Services.

How it works

{
        plugins = [
                f"Auth.dll",
                f"BasicHttpServer.dll",
                f"OutputComposing.dll"];

        instances = {
                server = HttpService(
                        prefixes = ["http://localhost:8080/"]
                ) {
                        http_branch = Sessionizer(
                                cookiename = "session"
                        ) {
                                http_branch = Template(
                                        f"index.html");
// index.html contains {% session %} and will display
// the session cookie.
                        };
                };
        };
}

Settings

cookiename the name that will be given to the session cookie in both the visitor's browser and in context under this service

Branches

http program flow will be handed over to this branch after the session cookie has been determined