V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
mihuoli
V2EX  ›  Node.js

使用 koa-router 无法添加 COOKIE

  •  
  •   mihuoli · 2017-05-10 15:20:08 +08:00 · 2799 次点击
    这是一个创建于 2514 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用了 koa-router 使用 chrome 和 nodejs  调试 发现 cookie 一直未被添加 代码如下:

    router.get('/login', async function (ctx, next) {
        ctx.state = {
            title: 'koa2 admin hello'
        };
        ctx.cookies.set("nidaye1","nidadadaye");
        await ctx.render('admin/login', {});
    })
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5299 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 09:23 · PVG 17:23 · LAX 02:23 · JFK 05:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.