I have created a custom module 'sample'.I have created 'user_login' hook.I want to call a function 'calltype' within user_login hook but the function is not called.Cookie is created If I write the callType function code after the line $anivpopup = '1';
in user_login hook
function sample_user_login(&$edit, $account){
$anivpopup = '1';
callType();
}
function callType(){
$anivpopup =1;
if($anivpopup == '1'){
setcookie('test', '2', time()+3600); //cookie set for 1 hr
}
}