Added session controller and support functions