Use the real username in preferences and magic cookie instead of case-insensitive user input. Fixes 4616.