Adjusted the way to get an session.