Can't login in Mac App Store or iCloud - login loading forever
NOTE: This solution is primarily meant for users of physical Apple devices, such as MacBooks, iMacs, Mac Pros, etc. While I will mention a link to a solution for virtual machine users as well, that is not the primary objective of this post. As such, that will not be posted here, for succinctness.

Also, while NVRAM (non-volatile RAM) does save certain settings and parameters for long-term, iCloud settings don't appear to be among the settings saved in NVRAM.

The solution will sound simple - but it's not. The full-out solution is a three-step process, which will force OS X to do the following: 


Wipe the existing, problematic settings file(s), and force OS X to reproduce valid ones in there place. 
(Re)Start the iCloud service and/or its required related Daemons. 
Validate/rewrite (hardware) machine details if required.


We’ll start by deleting the following file (admin permission required):
/Library/Preferences/com.apple.apsd.plist

We’ll then ensure that the proper LaunchDaemons are running - in this case, Push Notifications. iCloud needs this running to operate. Enter the following into Terminal:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.apsd.plist

Finally, please check to make sure that your OS X device has a (valid) Serial Number. Whether it’s real or virtual machine, the Serial must be less than 12 chars - otherwise, iCloud -based services like FaceTime and iMessage won’t be able to sign in (or will ‘hang-up’ at sign in attempt). Check this in your Mac’s ‘About’ section. If you have either a NULL or invalid Serial Number, please do one of the following:


Either use your Apple Care/Warranty to contact Apple. Have them set your hardware Serial Number, seeing that they were supposed to do this when they were done servicing your machine. 


OR


Use the following application to change this (if you can't go to Apple for any reason, and aren't worried about voiding the device's warranty). Please do NOT use this tool if you have Apple Care or would like to preserve your Apple Warranty:


Blank Board Serializer -
Downloadable from here:

http://rogersm.net/icloud-problems-mountain-lion-serial-number



Now, for those of you using a virtual machine, please go here to complete the third step (Serial Number reset). You'll need to generate a valid, new Serial Number that is NOT currently in-use:

http://www.insanelymac.com/forum/topic/292170-how-to-spoof-real-mac-in-vmware/



That should fix any issues with iCloud sign in and use of its related services for El Capitan. Works for most physical Mac OS X devices and VMware Workstation installations.