Refactors chat bar and sets cookie in browser