mod before_request and cookie set