fix error with set cookie on login