Fix bug978771 - Only use cookie middleware if the method is not options