refactor lamguage cookie handling code
factor out language cookie handling to BaseController