views:

32

answers:

1

Hi,

Is there a way to count total number of active sessions (e.g. in 10 minutes) on Google App Engine (Python)?

I want to show something on frontpage like, This site currently haz 200 people online

+1  A: 

Considering the distributed nature of GAE, I don't think you can do this directly.

You can store visits in the database (with timestamp) and query this (use a cookie to check if a user is already counted, avoid writing on each request!).

Alternatively, you can use some external service that uses included javascript or image that counts this for you, much like how analytics works.

Ivo van der Wijk
How about [Java](http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions)? Is python session stored in memcache too?
est
App Engine's python runtime doesn't have a builtin session library; the one you choose to use may or may not use memcache.
Wooble