use middleware for warper cookie