嗯, 这样还是不太满足cnpm的场景, 我在pr里面列一下现在npm生成authSession的思路  

----

@fengmk2 (https://twitter.com/fengmk2)
@Python发烧友 (http://weibo.com/imk2/profile)
http://fengmk2.github.com (http://fengmk2.github.com/)

---------------------------
*记得当时年纪小/
你爱谈天，我爱笑/
有一回并肩坐在桃树下/
风在林梢鸟儿在叫/
我们不知怎样睡着了/
梦里花落知多少*


On Friday, March 14, 2014 at 6:10 PM, dead_horse wrote:

> In lib/koa-session.js:
> > + }); > + // ignore if no sessionId > + if (!this.sessionId) { > + debug('can not found session id, set session does not work'); > + return; > + } > + } > + > + touchSession = true; > + this._session = value; > + }); > + > + yield *next; > + > + if (touchSession) { > + yield *refreshSession.call(this, this._session, isNew, originalHash);  
> 现在的逻辑是 只要访问了session, yield this.session 就会生成一个 sessionID
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/dead-horse/koa-session/pull/7/files#r10601842).
>  
>  
>