Moving cookie install and redirect properly