Secbone / koa-session2

Middleware for Koa2 to get/set session
MIT License
152 stars 30 forks source link

(fix) when multi client connect to the server #12

Closed novrain closed 8 years ago

novrain commented 8 years ago

When current session context changed, should store it by the sid of current session which is get from the request cookies, otherwise the last client will over write the prev one' session info.

Case: first , use Chrome as client 1, then use IE as client 2 connect to the server. the store.session only contain one key, the client 2 will overwrite the client 1, because the opts.sid is global.

Secbone commented 8 years ago

I dont understand why the session would be overwrite, because the sid is not global. sid is generated by your Store. I think there may have some problem in your Store. :)

novrain commented 8 years ago

I use the default store. Would please try the case?

Secbone commented 8 years ago

@novrain Oh, I got it! But your code seems not pass the travis. Could you check it ?

novrain commented 8 years ago

Sorry, I have not login github this days :) Glad to see you fix it and add test case. Thank you!