Fix to user login and logout (Cookies not setting after content output)