Use session as parameter also for production mode