function _bakery_bake_chocolatechip_cookie in Bakery Single Sign-On System 7.2
Same name and namespace in other branches
- 6.2 bakery.module \_bakery_bake_chocolatechip_cookie()
- 6 bakery.module \_bakery_bake_chocolatechip_cookie()
- 7.4 bakery.module \_bakery_bake_chocolatechip_cookie()
Create a new cookie for identification.
5 calls to _bakery_bake_chocolatechip_cookie()
- bakery_login in ./
bakery.module - Special Bakery login callback authenticates the user and returns to slave.
- bakery_register in ./
bakery.module - Special Bakery register callback registers the user and returns to slave.
- bakery_user_login in ./
bakery.module - Implements hook_user_login().
- bakery_user_update in ./
bakery.module - Implements hook_user_update().
- _bakery_taste_chocolatechip_cookie in ./
bakery.module - Test identification cookie.
File
- ./
bakery.module, line 1302 - Module file for the Bakery.
Code
function _bakery_bake_chocolatechip_cookie($name, $mail, $init) {
$key = variable_get('bakery_key', '');
if (!empty($key)) {
$cookie = array();
$cookie['name'] = $name;
$cookie['mail'] = $mail;
$cookie['init'] = $init;
$cookie['master'] = variable_get('bakery_is_master', 0);
$cookie['calories'] = 480;
$cookie['timestamp'] = $_SERVER['REQUEST_TIME'];
$cookie_secure = !variable_get('bakery_loose_ssl', FALSE) && ini_get('session.cookie_secure');
$type = _bakery_cookie_name('CHOCOLATECHIP');
$cookie['type'] = $type;
$data = bakery_bake_data($cookie);
// Allow cookies to expire when the browser closes.
$expire = variable_get('bakery_freshness', ini_get('session.cookie_lifetime')) > 0 ? $_SERVER['REQUEST_TIME'] + variable_get('bakery_freshness', ini_get('session.cookie_lifetime')) : '0';
setcookie($type, $data, $expire, '/', variable_get('bakery_domain', ''), $cookie_secure, TRUE);
}
}