Koa.js Tutorial to Delete Existing Cookies with Expiration Time Using ctx.cookies.set() Method in Browser Full Project For Beginners


Welcome folks today in this blog post we will be deleting cookies in browser with expiration time in koa.js using ctx.cookies.set() method.All the full source code of the application is shown below.




Get Started




In order to get started you need to make an index.js file and copy paste the following code






var koa = require('koa');
var router = require('koa-router');
var app = koa();

_.get('/', setACookie);

function *setACookie(){
   //Expires after 360000 ms from the time it is set.
   this.cookies.set('name', '');

var _ = router();


Leave a Reply