You are here

function flag_set_sid in Flag 7.2

Same name and namespace in other branches
  1. 6.2 flag.module \flag_set_sid()
  2. 7.3 flag.module \flag_set_sid()

Set the Session ID for a user. Utilizes the Session API module.

1 call to flag_set_sid()
flag_get_sid in ./flag.module
Get the Session ID for a user. Utilizes the Session API module.

File

./flag.module, line 2057
The Flag module.

Code

function flag_set_sid($uid = NULL, $create = TRUE) {
  $sids =& drupal_static(__FUNCTION__, array());
  if (!isset($uid)) {
    $uid = $GLOBALS['user']->uid;
  }
  if (!isset($sids[$uid])) {
    if (module_exists('session_api') && session_api_available() && $uid == 0) {
      $sids[$uid] = session_api_get_sid($create);
    }
    else {
      $sids[$uid] = 0;
    }
  }
  return $sids[$uid];
}