Fix bug that not put profile in cookie