You are here

function sess_count in Memcache API and Integration 5.2

Same name in this branch
  1. 5.2 session-memcache.inc \sess_count()
  2. 5.2 session-memcache-db.inc \sess_count()
  3. 5.2 session-memcache.db.inc \sess_count()
Same name and namespace in other branches
  1. 5 memcache-session.inc \sess_count()
  2. 6 memcache-session.inc \sess_count()

Counts how many users have sessions. Can count either anonymous sessions, authenticated sessions, or both.

Parameters

int $timestamp: A Unix timestamp representing a point of time in the past. The default is 0, which counts all existing sessions.

int $anonymous: TRUE counts only anonymous users. FALSE counts only authenticated users. Any other value will return the count of both authenticated and anonymous users.

Return value

int The number of users with sessions.

File

./session-memcache-db.inc, line 150
User session handling functions.

Code

function sess_count($timestamp = 0, $anonymous = true) {

  /*
  $query = $anonymous ? ' AND uid = 0' : ' AND uid > 0';
  return db_result(db_query('SELECT COUNT(sid) AS count FROM {sessions} WHERE timestamp >= %d'. $query, $timestamp));
  */
}