Migrate to cookie based authentication