Set up cookie middlewares in the service provider.