Added the ability to restore local profile state from the cookie saved on the client.