I'm trying to set value some custom variable for some web service calls based on user is logged in or not. I'm using following code, but it is not setting up the value of the variable.
function mymodule_user_login(&$edit, $account) {
if ($account->uid > 0 ) {
ini_set('saf.service_value', 'user-Auth');
}
}
function mymodule_user_logout($account) {
ini_set('saf.service_value', 'user-Anon');
}
Update #1 The web service is provided by third/forth party and we have no control over it. It allow us to set value in .htaccess file. Since we are using Apache 2.2, we are not able to use directive. With my findings so far, I think we can't set can't set custom variables using init_set(), we can only allow to set predefined variables only (Please confirm if it is correct, I didn't find any documentation/blog post that conform it). If I set the variable in .htaccess file as follows
php_value saf.service_value "user-Anon"
it works perfectly, I just want to set that value dynamically.