Add missing middleware and cookieSecret

/to @raymondfeng