Fixed all the template references to session.