Himanshu,
I can't tell completely what you are doing, but:
" Added following line in index() of default controller"
Does "default controller" mean your own controller? If that is the case, then you are not loading the variables you need - see controllers/auth lines: 86 -100
Your mistake is, if the user is not logged in, you should REDIRECT them to auth/login and let that function load the view, not load the view yourself