How to determine current active users in CouchDB?

折月煮酒 提交于 2019-12-12 18:11:54

问题


Is it possible to query current active sessions with couchdb?

The server is able to keep track of sessions based on the timeout value so how would I figure out what users have an active session?


回答1:


CouchDB doesn't knows anything about active sessions. These "sessions" are actually based on HTTP Cookie, which holds username, timestamp and signature hash. When CouchDB handling the request, it decodes cookie's AuthSession value and verifies that:

  • Username is correct and exists
  • Timestamp + TTL isn't lesser than current time
  • Signature is valid

If all these conditions are ok: request is accepted for further processing. If Timestamp is closer to expiration border, CouchDB updates the cookie to make the "session" last longer.

For this scheme there is no reason and need to maintain internal list of active sessions.



来源:https://stackoverflow.com/questions/22675393/how-to-determine-current-active-users-in-couchdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!