add polaris session, middleware