1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| app.keys = ['good day'] app.use(async(ctx,next)=>{ console.log('cookies start') ctx.cookies.set('user','tobi',{ domain : 'localhost', path : '/', maxAge : 10 * 60 * 1000, expires : new Date('2022-02-09'), httpOnly : false, overwrite : false, signed : true }) await next() console.log('cookies end',ctx.cookies.get('user')) })
|