Move login/logout function to AppCtrl so that they can be invoked in AppCtrl.
update the cookie name as access_token