Fix missing trailing slash on session in ensureAuthentication method