function flag_set_sid in Flag 6.2
Same name and namespace in other branches
- 7.3 flag.module \flag_set_sid()
- 7.2 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 1667 - The Flag module.
Code
function flag_set_sid($uid = NULL, $create = TRUE) {
static $sids = 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];
}