Added functions to retrieve session.