Add (probably broken) session functionality
Fix session