Fixed login cookie and session initialization