When users are on wikidata.org (w/o the www.), they've had problems with being able to edit stuff.
Not sure what/if anything can be done in the code itself to alleviate this, but think it's more likely and helpful to adjust the apache and other configs to get it *right*.
Version: wmf-deployment
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=44612
https://bugzilla.wikimedia.org/show_bug.cgi?id=41847
https://bugzilla.wikimedia.org/show_bug.cgi?id=49261
https://bugzilla.wikimedia.org/show_bug.cgi?id=54273