View Source HanoiWeb.Session.IdPlug (Towers of Hanoi v1.0.0)

Ensures each user-session has a unique identifier.

This module plugs into the phoenix request handling and checks if a session_id exists. If it doesn't it creates one based on a 4-digit hexadecimal random number.

A TowerState GenServer and ETS table are created per-session and use this id as their unique name.

Summary

Functions

Check session for an :session_id variable and create one if missing.

Functions

Check session for an :session_id variable and create one if missing.