[BUGFIX] Set correct cookie when permalogin is enabled