Some sample code that tracks sessions