Implemented cookie sessions and improved config