Fixed middleware to use sessions. Updated utilities to take advantage of middleware session storage