开发者

How to check user online with django and GAE?

I'm using Django with Google App Engine and I want to build a module for checking online/offline user . But GAE don'开发者_如何转开发t support session so it's hard for me to find way to do it. how can i resolve this problem? Any ideas would be appreciated, thanks.


A session library won't solve this, because HTTP is stateless. Using sessions, you can determine when someone last made a request, but that doesn't tell you if they're "online" or not - they could have immediately closed their browser tab, or they could leave it open for a week.

If you really, really need to do this, you could use the channel API. Alternately, you could use a session library, or log users in using the Users API, and list as 'online' anyone who's made requests in the last n minutes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜