Nodejs middleware cookie-how does Parser transmit cookies to clients

  node.js, question
Routing file: demo1.js:
 var express = require('express');
 var router = express.Router();
 router.post('/', function(req, res, next) {
 res.redirect("/demo1");
 res.cookie('username', 'koby', {maxAge: 900000 });
 });
 module.exports = router;
 ``
It has been added in app.js
 var cookieParser = require('cookie-parser');
 var app = express();
Ask why you prompt error when you request it.
 Seek a solution, thank you!
//This line of What Do You Mean?  Do you want to jump?
 res.redirect("/demo1");
 //How do you write Cookie now that you have all jumped?
 res.cookie('username', 'koby', {maxAge: 900000 });

Two rows of transposition is good