[#2199] Fixing issue to make the serialized data on the User object match up with how equals works
Merge branch '2.0' into 2.1

Conflicts:
	cookbook/security/entity_provider.rst
[#2199] Porting fix up to 2.1 branch