Session middleware for toa.